We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7bb6f63 + c44218b commit bbfdf33Copy full SHA for bbfdf33
spec/core_ext/hash_with_indifferent_access_spec.rb
@@ -19,6 +19,14 @@
19
expect(@hash.fetch("foo", nil)).to eq("bar")
20
expect(@hash.fetch(:foo)).to eq("bar")
21
expect(@hash.fetch(:foo, nil)).to eq("bar")
22
+
23
+ expect(@hash.fetch("baz")).to eq("bee")
24
+ expect(@hash.fetch("baz", nil)).to eq("bee")
25
+ expect(@hash.fetch(:baz)).to eq("bee")
26
+ expect(@hash.fetch(:baz, nil)).to eq("bee")
27
28
+ expect { @hash.fetch(:missing) }.to raise_error(IndexError)
29
+ expect(@hash.fetch(:missing, :found)).to eq(:found)
30
end
31
32
it "has key checkable by either strings or symbols" do
0 commit comments