Browse files

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

  • Loading branch information...
1 parent 0667bfb commit bfc4fefe119d2c7cc0df98ff14f764dbcc8c445f @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 bfc4fef

Please sign in to comment.