diff options
author | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-04-28 19:50:06 +0000 |
---|---|---|
committer | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-04-28 19:50:06 +0000 |
commit | 4fbb9aa3cb6c31ec128bfb31f59efa66d66adba4 (patch) | |
tree | 84a654b260261fe172f2584f60b3ba93e59f841d /spec/ruby/core/hash/fetch_values_spec.rb | |
parent | b864bd05bff2a61d55b08deb92e969f9fa55e07c (diff) |
Update to ruby/spec@6f38a82
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/ruby/core/hash/fetch_values_spec.rb')
-rw-r--r-- | spec/ruby/core/hash/fetch_values_spec.rb | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/spec/ruby/core/hash/fetch_values_spec.rb b/spec/ruby/core/hash/fetch_values_spec.rb index 1b093f4aa9..a4af153bf7 100644 --- a/spec/ruby/core/hash/fetch_values_spec.rb +++ b/spec/ruby/core/hash/fetch_values_spec.rb @@ -2,32 +2,30 @@ require_relative '../../spec_helper' require_relative 'fixtures/classes' require_relative '../../shared/hash/key_error' -ruby_version_is "2.3" do - describe "Hash#fetch_values" do - before :each do - @hash = { a: 1, b: 2, c: 3 } - end +describe "Hash#fetch_values" do + before :each do + @hash = { a: 1, b: 2, c: 3 } + end - describe "with matched keys" do - it "returns the values for keys" do - @hash.fetch_values(:a).should == [1] - @hash.fetch_values(:a, :c).should == [1, 3] - end + describe "with matched keys" do + it "returns the values for keys" do + @hash.fetch_values(:a).should == [1] + @hash.fetch_values(:a, :c).should == [1, 3] end + end - describe "with unmatched keys" do - it_behaves_like :key_error, ->(obj, key) { obj.fetch_values(key) }, Hash.new(a: 5) + describe "with unmatched keys" do + 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"] - @hash.fetch_values(:a, :z) { |key| "`#{key}' is not found" }.should == [1, "`z' is not found"] - end + it "returns the default value from block" do + @hash.fetch_values(:z) { |key| "`#{key}' is not found" }.should == ["`z' is not found"] + @hash.fetch_values(:a, :z) { |key| "`#{key}' is not found" }.should == [1, "`z' is not found"] end + end - describe "without keys" do - it "returns an empty Array" do - @hash.fetch_values.should == [] - end + describe "without keys" do + it "returns an empty Array" do + @hash.fetch_values.should == [] end end end |