Skip to content

Commit

Permalink
check against RuntimeError for Ruby < 2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
baseballlover723 committed Sep 1, 2021
1 parent 8194318 commit 02c6912
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion spec/addressable/uri_spec.rb
Expand Up @@ -1061,7 +1061,9 @@ def to_s
end

it "should not allow destructive operations" do
expect { @uri.normalize! }.to raise_error(FrozenError)
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)
end
end

Expand Down

0 comments on commit 02c6912

Please sign in to comment.