diff options
author | Yusuke Endoh <mame@ruby-lang.org> | 2020-03-16 23:32:55 +0900 |
---|---|---|
committer | Yusuke Endoh <mame@ruby-lang.org> | 2020-03-16 23:38:26 +0900 |
commit | d514ba8e17106c6d159c3902ac5456d6269731f8 (patch) | |
tree | 4a0be3434f9aeeea98f7f94f6d830a0d19a52377 /spec/ruby/core/hash | |
parent | 304538e6ff64b8daadde5456988fb9f82c6a4849 (diff) | |
download | ruby-d514ba8e17106c6d159c3902ac5456d6269731f8.tar.gz |
`Proc` made by `Hash#to_proc` should be a lambda [Bug #12671]
Like `Symbol#to_proc` (f0b815dc670b61eba1daaa67a8613ac431d32b16)
Diffstat (limited to 'spec/ruby/core/hash')
-rw-r--r-- | spec/ruby/core/hash/to_proc_spec.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/spec/ruby/core/hash/to_proc_spec.rb b/spec/ruby/core/hash/to_proc_spec.rb index 3e7e57d11f..700621f162 100644 --- a/spec/ruby/core/hash/to_proc_spec.rb +++ b/spec/ruby/core/hash/to_proc_spec.rb @@ -19,8 +19,16 @@ describe "Hash#to_proc" do @proc = @hash.to_proc end - it "is not a lambda" do - @proc.lambda?.should == false + ruby_version_is ""..."2.8" do + it "is not a lambda" do + @proc.lambda?.should == false + end + end + + ruby_version_is "2.8" do + it "is a lambda" do + @proc.lambda?.should == true + end end it "raises ArgumentError if not passed exactly one argument" do |