diff options
Diffstat (limited to 'spec/ruby/core/hash/fetch_spec.rb')
| -rw-r--r-- | spec/ruby/core/hash/fetch_spec.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/ruby/core/hash/fetch_spec.rb b/spec/ruby/core/hash/fetch_spec.rb index 753167f709..f9b80b6c49 100644 --- a/spec/ruby/core/hash/fetch_spec.rb +++ b/spec/ruby/core/hash/fetch_spec.rb @@ -4,7 +4,7 @@ require_relative '../../shared/hash/key_error' describe "Hash#fetch" do context "when the key is not found" do - it_behaves_like :key_error, -> obj, key { obj.fetch(key) }, Hash.new(a: 5) + it_behaves_like :key_error, -> obj, key { obj.fetch(key) }, Hash.new({ a: 5 }) it_behaves_like :key_error, -> obj, key { obj.fetch(key) }, {} it_behaves_like :key_error, -> obj, key { obj.fetch(key) }, Hash.new { 5 } it_behaves_like :key_error, -> obj, key { obj.fetch(key) }, Hash.new(5) @@ -12,7 +12,7 @@ describe "Hash#fetch" do it "formats the object with #inspect in the KeyError message" do -> { {}.fetch('foo') - }.should raise_error(KeyError, 'key not found: "foo"') + }.should.raise(KeyError, 'key not found: "foo"') end end @@ -38,7 +38,7 @@ describe "Hash#fetch" do end it "raises an ArgumentError when not passed one or two arguments" do - -> { {}.fetch() }.should raise_error(ArgumentError) - -> { {}.fetch(1, 2, 3) }.should raise_error(ArgumentError) + -> { {}.fetch() }.should.raise(ArgumentError) + -> { {}.fetch(1, 2, 3) }.should.raise(ArgumentError) end end |
