aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_symbol.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-02-22 00:32:43 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-02-22 00:45:05 +0900
commit8c5ca318cbe57269f144a4d0822c5283c1fd4e1a (patch)
tree8affdb4955703701e4b9ee9bf0ed6bc0c42da5a3 /test/ruby/test_symbol.rb
parent5cab86f3b0725457be3c50d3cab43b04bea53290 (diff)
downloadruby-8c5ca318cbe57269f144a4d0822c5283c1fd4e1a.tar.gz
`Proc` made by `Symbol#to_proc` should be a lambda [Bug #16260]
With refinements, too.
Diffstat (limited to 'test/ruby/test_symbol.rb')
-rw-r--r--test/ruby/test_symbol.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_symbol.rb b/test/ruby/test_symbol.rb
index 2e9710e4dc..632acb3e3d 100644
--- a/test/ruby/test_symbol.rb
+++ b/test/ruby/test_symbol.rb
@@ -169,6 +169,9 @@ class TestSymbol < Test::Unit::TestCase
def _test_to_proc_arg_with_refinements_call(&block)
block.call TestToPRocArgWithRefinements.new
end
+ def _test_to_proc_with_refinements_call(&block)
+ block
+ end
using Module.new {
refine TestToPRocArgWithRefinements do
def hoge
@@ -180,6 +183,10 @@ class TestSymbol < Test::Unit::TestCase
assert_equal(:hoge, _test_to_proc_arg_with_refinements_call(&:hoge))
end
+ def test_to_proc_lambda_with_refinements
+ assert_predicate(_test_to_proc_with_refinements_call(&:hoge), :lambda?)
+ end
+
def self._test_to_proc_arg_with_refinements_call(&block)
block.call TestToPRocArgWithRefinements.new
end