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 56e84af
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion spec/addressable/uri_spec.rb
Expand Up @@ -1061,7 +1061,8 @@ def to_s
end

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

Expand Down

0 comments on commit 56e84af

Please sign in to comment.