/vendor/gems/facets-2.4.5/test/more/test_1stclassmethod.rb

https://bitbucket.org/mediashelf/fedora-migrator · Ruby · 21 lines · 15 code · 6 blank · 0 comment · 0 complexity · 173c5af38840a27f53a45c68d86d177a MD5 · raw file

  1. require 'test/unit'
  2. require 'facets/1stclassmethod'
  3. class Test1stClassMethod < Test::Unit::TestCase
  4. class TestWith
  5. def foo ; end
  6. end
  7. def test_method!
  8. t = TestWith.new
  9. assert_equal( t.method!(:foo).__id__, t.method!(:foo).__id__ )
  10. assert_not_equal( t.method(:foo).__id__, t.method(:foo).__id__ )
  11. end
  12. def test_this
  13. assert_equal( this, method(:test_this) )
  14. end
  15. end