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

Commit

Permalink
Add tests for the descriptions of operator matchers
Browse files Browse the repository at this point in the history
  • Loading branch information
nevinera committed May 8, 2024
1 parent 68883ac commit 4193cbf
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/rspec/matchers/built_in/operators_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,12 @@ def method_missing(name, *args, &block)
o.should != o
}.to raise_error(/does not support `should != .*Use `should_not ==/)
end

it "is described correctly" do
matcher = 7.should
matcher.==(7)
expect(matcher.description).to eq("== 7")
end
end

describe RSpec::Matchers::BuiltIn::NegativeOperatorMatcher do
Expand All @@ -259,5 +265,11 @@ def method_missing(name, *args, &block)
o.should_not != :foo
}.to raise_error(/does not support `should_not != .*Use `should ==/)
end

it "is described correctly" do
matcher = 7.should_not
matcher.==(8)
expect(matcher.description).to eq("== 8")
end
end
end

0 comments on commit 4193cbf

Please sign in to comment.