Skip to content
Browse files

Apparently even the error type varies from version to version. Awesome.

  • Loading branch information...
1 parent 45e1345 commit c23599c72f3e1dc5eeb371ea02a93d95579d6e38 @sporkmonger committed Mar 5, 2013
Showing with 8 additions and 6 deletions.
  1. +8 −6 spec/addressable/uri_spec.rb
View
14 spec/addressable/uri_spec.rb
@@ -324,9 +324,10 @@ def to_s
end
it "should not allow destructive operations" do
- (lambda do
- @uri.normalize!
- end).should raise_error(RuntimeError)
+ expect { @uri.normalize! }.to raise_error { |error|
+ error.message.should match(/can't modify frozen/)
+ error.should satisfy { |e| RuntimeError === e || TypeError === e }
+ }
end
end
@@ -447,9 +448,10 @@ def to_s
end
it "should not allow destructive operations" do
- (lambda do
- @uri.normalize!
- end).should raise_error(RuntimeError)
+ expect { @uri.normalize! }.to raise_error { |error|
+ error.message.should match(/can't modify frozen/)
+ error.should satisfy { |e| RuntimeError === e || TypeError === e }
+ }
end
end

0 comments on commit c23599c

Please sign in to comment.
Something went wrong with that request. Please try again.