mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Space out test_prepend_super_in_alias assert
Also tried to fix it, however the problem lies with how aliased methods are done and their internal structure. mruby simply aliases methods by grabbing the RProc and giving it a new name, super then determines the original method to call by using the name so a method called m, aliased as m2, will call the m2 super method instead of m
This commit is contained in:
+10
-2
@@ -720,17 +720,25 @@ assert('Module#prepend') do
|
||||
p = labeled_module("P") do
|
||||
def m; "P"+super; end
|
||||
end
|
||||
|
||||
a = labeled_class("A") do
|
||||
def m; "A"; end
|
||||
end
|
||||
|
||||
b = labeled_class("B", a) do
|
||||
def m; "B"+super; end
|
||||
alias m2 m
|
||||
prepend p
|
||||
alias m3 m
|
||||
end
|
||||
assert_equal("BA", b.new.m2, bug7842)
|
||||
assert_equal("PBA", b.new.m3, bug7842)
|
||||
|
||||
assert_nothing_raised do
|
||||
assert_equal("BA", b.new.m2, bug7842)
|
||||
end
|
||||
|
||||
assert_nothing_raised do
|
||||
assert_equal("PBA", b.new.m3, bug7842)
|
||||
end
|
||||
end
|
||||
|
||||
assert 'test_prepend_each_classes' do
|
||||
|
||||
Reference in New Issue
Block a user