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:
Corey Powell
2015-07-13 10:42:33 -05:00
parent 81a2b3431c
commit 11cb41770d
+10 -2
View File
@@ -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