From 7b0f7070b2f4ce23d88f2e0c80148aa64c9f77ec Mon Sep 17 00:00:00 2001 From: Philip Ross Date: Tue, 31 Aug 2021 18:38:28 -0700 Subject: [PATCH] check against RuntimeError for Ruby < 2.5 --- spec/addressable/uri_spec.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/addressable/uri_spec.rb b/spec/addressable/uri_spec.rb index 9ab8038e..0d7262fd 100644 --- a/spec/addressable/uri_spec.rb +++ b/spec/addressable/uri_spec.rb @@ -1061,7 +1061,9 @@ def to_s end it "should not allow destructive operations" do - expect { @uri.normalize! }.to raise_error(FrozenError) + below_2_5 = Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.5.0") + error = below_2_5 ? RuntimeError : FrozenError + expect { @uri.normalize! }.to raise_error(error) end end