From 85aa3963b184f638557e1718bc24220ef9ca21f2 Mon Sep 17 00:00:00 2001 From: Philip Ross Date: Sun, 31 Jul 2022 19:06:59 -0700 Subject: [PATCH] update spec --- spec/addressable/uri_spec.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spec/addressable/uri_spec.rb b/spec/addressable/uri_spec.rb index 4e3aced9..dc2d0693 100644 --- a/spec/addressable/uri_spec.rb +++ b/spec/addressable/uri_spec.rb @@ -1060,9 +1060,10 @@ def to_s end it "should not allow destructive operations" do - 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) + expect { @uri.normalize! }.to raise_error { |error| + expect(error.message).to match(/can't modify frozen/) + expect(error).to satisfy { |e| RuntimeError === e || TypeError === e } + } end end