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

Commit

Permalink
make an expectation _about_ 'matcher == VALUE' for linter
Browse files Browse the repository at this point in the history
my prior '.==(VALUE)' solution passed linting on modern rubies, but
apparently on older rubies it still caused a message like

    possibly useless use of == in void context

This added expectation doesn't _entirely_ belong, but it's not
completely out of place, and it convinces the linter/parser not to
worry.
  • Loading branch information
nevinera committed May 9, 2024
1 parent d99adb5 commit f31af7e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spec/rspec/matchers/built_in/operators_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def method_missing(name, *args, &block)

it "is described correctly" do
matcher = 7.should
matcher.==(7)
expect(matcher == 7).to be_truthy
expect(matcher.description).to eq("== 7")
end
end
Expand All @@ -268,7 +268,7 @@ def method_missing(name, *args, &block)

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

0 comments on commit f31af7e

Please sign in to comment.