rubocop-rspec
rubocop-rspec copied to clipboard
Cop idea: discourage the use of `assert_`/`refute_` Minitest matchers
RSpec Expectations allows using assert_/refute_ Minitest matchers
However, RSpec comes with its matchers that pretty much cover the same:
- assert_equal a, b
+ expect(a).to eq(b)
A notable difference is that Minitest allows for an optional failure message. It's a lesser known RSpec feature, but it allows it, too:
- assert_equal a, b, "must be equal"
+ expect(a).to(eq(b), "must be equal")