From eb97eb08ee4d9791c74c1bd0b62535d7e4169129 Mon Sep 17 00:00:00 2001 From: naruse Date: Thu, 19 Feb 2015 07:13:14 +0000 Subject: merge revision(s) 49259: [Backport #10744] * 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/branches/ruby_2_2@49646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_refinement.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_refinement.rb b/test/ruby/test_refinement.rb index 400a72cbf7..5837f45d0f 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 + def test_refined_method_defined assert_separately([], <<-"end;") bug10753 = '[ruby-core:67656] [Bug #10753]' -- cgit v1.2.3