diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-10-23 02:03:56 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-10-23 02:03:56 +0000 |
commit | 9be1910ae060dcd4a824bd771116bded01a660c3 (patch) | |
tree | 0558b10a50cb7e2d0ffab89f187af4aceeeeba05 | |
parent | 2adba2dc5e4bb72bd475b2a07b119901c756388d (diff) | |
download | ruby-9be1910ae060dcd4a824bd771116bded01a660c3.tar.gz |
test_refinement.rb: Symbol#to_proc test
* test/ruby/test_refinement.rb (test_symbol_proc): a Symbol is
converted to a Proc in the caller's context. [Feature #9451]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | test/ruby/test_refinement.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_refinement.rb b/test/ruby/test_refinement.rb index 5e881edb91..3b3ceb048c 100644 --- a/test/ruby/test_refinement.rb +++ b/test/ruby/test_refinement.rb @@ -101,6 +101,10 @@ class TestRefinement < Test::Unit::TestCase def self.invoke_call_x_on(foo) return foo.call_x end + + def self.return_proc(&block) + block + end end end @@ -1743,6 +1747,7 @@ class TestRefinement < Test::Unit::TestCase def test_symbol_proc assert_equal("FooExt#x", FooExtClient.map_x_on(Foo.new)) + assert_equal("Foo#x", FooExtClient.return_proc(&:x).(Foo.new)) end private |