diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_symbol.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/ruby/test_symbol.rb b/test/ruby/test_symbol.rb index 36cbf4a710..6438ec8771 100644 --- a/test/ruby/test_symbol.rb +++ b/test/ruby/test_symbol.rb @@ -161,6 +161,36 @@ class TestSymbol < Test::Unit::TestCase assert_equal(1, first, bug11594) end + class TestToPRocArgWithRefinements; end + def _test_to_proc_arg_with_refinements_call(&block) + block.call TestToPRocArgWithRefinements.new + end + using Module.new { + refine TestToPRocArgWithRefinements do + def hoge + :hoge + end + end + } + def test_to_proc_arg_with_refinements + assert_equal(:hoge, _test_to_proc_arg_with_refinements_call(&:hoge)) + end + + def self._test_to_proc_arg_with_refinements_call(&block) + block.call TestToPRocArgWithRefinements.new + end + _test_to_proc_arg_with_refinements_call(&:hoge) + using Module.new { + refine TestToPRocArgWithRefinements do + def hoge + :hogehoge + end + end + } + def test_to_proc_arg_with_refinements_override + assert_equal(:hogehoge, _test_to_proc_arg_with_refinements_call(&:hoge)) + end + private def return_from_proc Proc.new { return 1 }.tap(&:call) end |