diff --git a/spec/addressable/uri_spec.rb b/spec/addressable/uri_spec.rb index 9ab8038e..4b41a775 100644 --- a/spec/addressable/uri_spec.rb +++ b/spec/addressable/uri_spec.rb @@ -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