/vendor/gems/facets-2.4.5/test/core/module/test_prepend.rb
Ruby | 29 lines | 17 code | 8 blank | 4 comment | 0 complexity | 16421f3226dc15d102cd6ee701e8d559 MD5 | raw file
Possible License(s): GPL-3.0, GPL-2.0, IPL-1.0, AGPL-1.0, LGPL-3.0
- require 'facets/module/prepend'
- require 'test/unit'
- class Test_Module_Prepend < Test::Unit::TestCase
- module M
- def q; "qm"; end
- end
- module N
- prepend M
- def q; "qn"; end
- end
- class X
- include N
- end
- def test_prepend_module_method
- assert_equal( "qm", N.q )
- end
- # Wish this worked.
- #def test_prepend_instance_method
- # assert_equal( "qm", X.new.q )
- #end
- end