diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-01-15 12:35:00 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-01-15 12:35:00 +0000 |
commit | 0fce0b7ba1337b25d717fc39481eef556d247005 (patch) | |
tree | 6727d5c8dd30f8fced14eccdf53d0aa722de4262 /test/ruby/test_refinement.rb | |
parent | 218029f06d0a43befac4a899dbeb302f901142ed (diff) | |
download | ruby-0fce0b7ba1337b25d717fc39481eef556d247005.tar.gz |
proc.c: singleton_method should not use refinements
* proc.c (rb_obj_singleton_method): Kernel#singleton_method should
not use refinements, as well as Kernel#method.
[ruby-core:67603] [Bug #10744]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_refinement.rb')
-rw-r--r-- | test/ruby/test_refinement.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/ruby/test_refinement.rb b/test/ruby/test_refinement.rb index 884d031c87..596c679610 100644 --- a/test/ruby/test_refinement.rb +++ b/test/ruby/test_refinement.rb @@ -1217,6 +1217,24 @@ class TestRefinement < Test::Unit::TestCase end; end + def test_singleton_method_should_not_use_refinements + assert_separately([], <<-"end;") + bug10744 = '[ruby-core:67603] [Bug #10744]' + + class C + end + + module RefinementBug + refine C.singleton_class do + def foo + end + end + end + + assert_raise(NameError, bug10744) { C.singleton_method(:foo) } + end; + end + private def eval_using(mod, s) |