/vendor/gems/facets-2.4.5/test/core/module/test_rename_method.rb
Ruby | 27 lines | 16 code | 10 blank | 1 comment | 0 complexity | bc0d9a8ae8cf0a1205dca9f290344b5a MD5 | raw file
Possible License(s): GPL-3.0, GPL-2.0, IPL-1.0, AGPL-1.0, LGPL-3.0
- require 'facets/module/rename_method'
- require 'test/unit'
- class Test_Module_Rename_Method < Test::Unit::TestCase
- def a; "A" ; end
- rename_method :b, :a
- def test_rename_method
- assert( ! respond_to?( :a ) )
- assert( respond_to?( :b ) )
- end
- # rename
- def c; "C" ; end
- rename :d, :c
- def test_rename
- assert( ! respond_to?( :c ) )
- assert( respond_to?( :d ) )
- end
- end