diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_refinement.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/ruby/test_refinement.rb b/test/ruby/test_refinement.rb index aeb519c18d..12a00bb16c 100644 --- a/test/ruby/test_refinement.rb +++ b/test/ruby/test_refinement.rb @@ -685,4 +685,28 @@ class TestRefinement < Test::Unit::TestCase assert_equal("#<refinement:#{c.inspect}@#{m.inspect}>", m.refinements[c].inspect) end + + module InlineMethodCache + class C + def foo + "original" + end + end + + module M + refine C do + def foo + "refined" + end + end + end + end + + def test_inline_method_cache + c = InlineMethodCache::C.new + f = Proc.new { c.foo } + assert_equal("original", f.call) + assert_equal("refined", InlineMethodCache::M.module_eval(&f)) + assert_equal("original", f.call) + end end |