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 4e6fa5f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion spec/addressable/uri_spec.rb
Expand Up @@ -1061,7 +1061,12 @@ def to_s
end

it "should not allow destructive operations" do
expect { @uri.normalize! }.to raise_error(FrozenError)
error = if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.5.0')
RuntimeError
else
FrozenError
end
expect { @uri.normalize! }.to raise_error(error)
end
end

Expand Down

0 comments on commit 4e6fa5f

Please sign in to comment.