PageRenderTime 1116ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

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

https://bitbucket.org/mediashelf/fedora-migrator
Ruby | 27 lines | 14 code | 11 blank | 2 comment | 0 complexity | a68cf8738a85c940324f555fc3d81637 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/redefine_method'
  2. require 'test/unit'
  3. class Test_Module_RedefineMethod < Test::Unit::TestCase
  4. # redef_method
  5. def a; "a"; end
  6. redefine_method(:a) { nil }
  7. def test_redefine_method
  8. assert_equal( nil, a )
  9. end
  10. # redef
  11. def b; "b"; end
  12. redef(:b) { "x" }
  13. def test_redef
  14. assert_equal( "x", b )
  15. end
  16. end