diff options
| author | Corey Powell <[email protected]> | 2015-07-13 10:42:33 -0500 |
|---|---|---|
| committer | Corey Powell <[email protected]> | 2015-07-13 10:45:57 -0500 |
| commit | 11cb41770dc7b36edac0af1e6784bd40d1c8243c (patch) | |
| tree | 8f0498d5b738a89365e0c9e736f27fa706f451c0 | |
| parent | 81a2b3431c63c969f73e6c0eeaa968acbace0e44 (diff) | |
| download | mruby-11cb41770dc7b36edac0af1e6784bd40d1c8243c.tar.gz mruby-11cb41770dc7b36edac0af1e6784bd40d1c8243c.zip | |
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
| -rw-r--r-- | test/t/module.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/test/t/module.rb b/test/t/module.rb index 89cc257a6..605ca28a7 100644 --- a/test/t/module.rb +++ b/test/t/module.rb @@ -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 |
