diff options
author | Jean byroot Boussier <jean.boussier+github@shopify.com> | 2023-05-23 15:51:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-23 15:51:28 +0200 |
commit | 31ac8efca8ecb574e1e7b7c32cce54cb1b97f19a (patch) | |
tree | aa374c742c0dbac38313ede9a49df297a4ef4bf6 /spec/ruby/core/hash/fetch_values_spec.rb | |
parent | 98637d421dbe8bcf86cc2effae5e26bb96a6a4da (diff) |
Hash.new: print a deprecation warning when receiving keyword arguments (#7828)
[Feature #19236]
In Ruby 3.3, `Hash.new` shall print a deprecation warning if keyword arguments
are passed instead of treating them as an implicit positional Hash.
This will allow to safely introduce a `capacity` keyword argument in 3.4
Co-authored-by: Jean Boussier <byroot@ruby-lang.org>
Notes
Notes:
Merged-By: byroot <byroot@ruby-lang.org>
Diffstat (limited to 'spec/ruby/core/hash/fetch_values_spec.rb')
-rw-r--r-- | spec/ruby/core/hash/fetch_values_spec.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/ruby/core/hash/fetch_values_spec.rb b/spec/ruby/core/hash/fetch_values_spec.rb index af3673f6ef..0cd48565af 100644 --- a/spec/ruby/core/hash/fetch_values_spec.rb +++ b/spec/ruby/core/hash/fetch_values_spec.rb @@ -19,7 +19,7 @@ describe "Hash#fetch_values" do end describe "with unmatched keys" do - it_behaves_like :key_error, -> obj, key { obj.fetch_values(key) }, Hash.new(a: 5) + it_behaves_like :key_error, -> obj, key { obj.fetch_values(key) }, Hash.new({ a: 5 }) it "returns the default value from block" do @hash.fetch_values(:z) { |key| "`#{key}' is not found" }.should == ["`z' is not found"] |