Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit bfc4fefe119d2c7cc0df98ff14f764dbcc8c445f 1 parent 0667bfb
@sporkmonger authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.