diff options
author | Jerry Cheung <jch@whatcodecraves.com> | 2013-02-12 10:27:06 -0800 |
---|---|---|
committer | Jerry Cheung <jch@whatcodecraves.com> | 2013-02-12 10:27:06 -0800 |
commit | fafcc5a7137decf9d0c673a977b94a434a8e84dd (patch) | |
tree | a0da3179921dba5af0949bce599355ba57775ee1 | |
parent | 6af738f3984a644372266ac6d4b7557cbdf040e1 (diff) | |
download | hashie-fafcc5a7137decf9d0c673a977b94a434a8e84dd.tar.gz |
ruby 1.8 throws IndexError instead of KeyError
-rw-r--r-- | spec/hashie/mash_spec.rb | 3 |
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 |