Skip to content
This repository has been archived by the owner on Nov 30, 2024. It is now read-only.

Commit

Permalink
Avoid the inverted negative operator tests before 1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
nevinera committed May 9, 2024
1 parent f31af7e commit a58b458
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions spec/rspec/matchers/built_in/operators_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit a58b458

Please sign in to comment.