Skip to content

Commit

Permalink
update spec
Browse files Browse the repository at this point in the history
  • Loading branch information
baseballlover723 committed Aug 1, 2022
1 parent 781ee9a commit 85aa396
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions spec/addressable/uri_spec.rb
Expand Up @@ -1060,9 +1060,10 @@ def to_s
end

it "should not allow destructive operations" do
ruby_check = Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.5.0")
error = ruby_check ? RuntimeError : FrozenError
expect { @uri.normalize! }.to raise_error(error)
expect { @uri.normalize! }.to raise_error { |error|
expect(error.message).to match(/can't modify frozen/)
expect(error).to satisfy { |e| RuntimeError === e || TypeError === e }
}
end
end

Expand Down

0 comments on commit 85aa396

Please sign in to comment.