diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-17 16:12:03 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-17 16:12:03 +0000 |
commit | 69dd06ae685b41ed9a77c4b2bdfa5587c12c5019 (patch) | |
tree | c3bf7730029ffff998bca90fb4468ce664480858 /test | |
parent | 2c5463fe99df8868e53817af834f1ecec9875515 (diff) | |
download | ruby-69dd06ae685b41ed9a77c4b2bdfa5587c12c5019.tar.gz |
* eval.c (frame_func_id): return proper method ID.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_method.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_method.rb b/test/ruby/test_method.rb index 5f436406a5..c7bd443785 100644 --- a/test/ruby/test_method.rb +++ b/test/ruby/test_method.rb @@ -43,4 +43,13 @@ class TestMethod < Test::Unit::TestCase um.bind(Base.new) end end + + def test_callee + assert_equal(:test_callee, __method__) + assert_equal(:m, Class.new {def m; __method__; end}.new.m) + assert_equal(:m, Class.new {def m; tap{return __method__}; end}.new.m) + assert_equal(:m, Class.new {define_method(:m) {__method__}}.new.m) + assert_equal(:m, Class.new {define_method(:m) {tap{return __method__}}}.new.m) + assert_nil(eval("class TestCallee; __method__; end")) + end end |