PageRenderTime 38ms CodeModel.GetById 13ms RepoModel.GetById 1ms app.codeStats 0ms

/vendor/gems/facets-2.4.5/test/core/module/test_rename_method.rb

https://bitbucket.org/mediashelf/fedora-migrator
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
  1. require 'facets/module/rename_method'
  2. require 'test/unit'
  3. class Test_Module_Rename_Method < Test::Unit::TestCase
  4. def a; "A" ; end
  5. rename_method :b, :a
  6. def test_rename_method
  7. assert( ! respond_to?( :a ) )
  8. assert( respond_to?( :b ) )
  9. end
  10. # rename
  11. def c; "C" ; end
  12. rename :d, :c
  13. def test_rename
  14. assert( ! respond_to?( :c ) )
  15. assert( respond_to?( :d ) )
  16. end
  17. end