From c42fc5b04811ec06900fc32f25437179efacb767 Mon Sep 17 00:00:00 2001 From: Eric Mueller Date: Thu, 9 May 2024 13:16:09 -0400 Subject: [PATCH] Avoid the inverted negative operator tests before 1.9 --- spec/rspec/matchers/built_in/operators_spec.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/spec/rspec/matchers/built_in/operators_spec.rb b/spec/rspec/matchers/built_in/operators_spec.rb index 6756c1bdf..00e1915f8 100644 --- a/spec/rspec/matchers/built_in/operators_spec.rb +++ b/spec/rspec/matchers/built_in/operators_spec.rb @@ -237,10 +237,10 @@ def method_missing(name, *args, &block) }.not_to raise_error end - it "complains when negated" do + it "complains when negated", :if => RUBY_VERSION.to_f >= 1.9 do expect { - o.should != o - }.to raise_error(/does not support `should != .*Use `should_not ==/) + o.should !~ o + }.to raise_error(/does not support `should !~ .*Use `should_not =~/) end it "is described correctly" do @@ -260,10 +260,10 @@ def method_missing(name, *args, &block) }.not_to raise_error end - it "complains when negated" do + it "complains when negated", :if => RUBY_VERSION.to_f >= 1.9 do expect { - o.should_not != :foo - }.to raise_error(/does not support `should_not != .*Use `should ==/) + o.should_not !~ :foo + }.to raise_error(/does not support `should_not !~ .*Use `should =~/) end it "is described correctly" do