rubocop / rubocop-rspec

Code style checking for RSpec files.
https://docs.rubocop.org/rubocop-rspec
MIT License
805 stars 277 forks source link

Unused code in predicate_matcher.rb ? #578

Open bquorning opened 6 years ago

bquorning commented 6 years ago

I looked at the code coverage report, and it looks like we have a couple of lines of untested code: https://github.com/rubocop-rspec/rubocop-rspec/blob/014a2001f46ddb62e3bddf0651735ff17459e434/lib/rubocop/cop/rspec/predicate_matcher.rb#L234-L235

I tried to add a spec that would exercise these lines, but it didn’t. So I suspect there is some predicate matcher that the include and respond_to matchers aren’t checked / autocorrected currently.

cc @pocke because of #442.

Darhazer commented 6 years ago

it turns out predicate_matcher_name? returns false for include and respond_to, as a perdicate_matcher should start_with?('be_', 'have_'). So it does not register an offense for include and respond_to

bquorning commented 6 years ago

Ping @pocke

pocke commented 6 years ago

Sorry I've forgotten this issue 🙇 I'll see it tonight.