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 | 205920e9c9a008f55bb1438d3d94c052ad758a4c (patch) | |
tree | 0558b10a50cb7e2d0ffab89f187af4aceeeeba05 | |
parent | 2e18e1b0f90a8b747e6e6c0c9e14f2944d9febb4 (diff) | |
download | ruby-205920e9c9a008f55bb1438d3d94c052ad758a4c.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 |