summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Cheung <jch@whatcodecraves.com>2013-02-12 10:27:06 -0800
committerJerry Cheung <jch@whatcodecraves.com>2013-02-12 10:27:06 -0800
commitfafcc5a7137decf9d0c673a977b94a434a8e84dd (patch)
treea0da3179921dba5af0949bce599355ba57775ee1
parent6af738f3984a644372266ac6d4b7557cbdf040e1 (diff)
downloadhashie-fafcc5a7137decf9d0c673a977b94a434a8e84dd.tar.gz
ruby 1.8 throws IndexError instead of KeyError
-rw-r--r--spec/hashie/mash_spec.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/spec/hashie/mash_spec.rb b/spec/hashie/mash_spec.rb
index 7559128..95821f5 100644
--- a/spec/hashie/mash_spec.rb
+++ b/spec/hashie/mash_spec.rb
@@ -341,7 +341,8 @@ describe Hashie::Mash do
context "when key does not exist" do
it "should raise KeyError" do
- expect { mash.fetch(:two) }.to raise_error(KeyError)
+ error = RUBY_VERSION =~ /1.8/ ? IndexError : KeyError
+ expect { mash.fetch(:two) }.to raise_error(error)
end
context "with default value given" do