Skip to content

Commit

Permalink
Suppress false positives of RSpec/RedundantPredicateMatcher
Browse files Browse the repository at this point in the history
This commit suppresses the following false positives of `RSpec/RedundantPredicateMatcher`:

```console
$ bundle exec rubocop

Offenses:

spec/rubocop/ast/processed_source_spec.rb:418:41: C: [Correctable] RSpec/RedundantPredicateMatcher:
Use start_with instead of be_start_with.
        expect(processed_source).not_to be_start_with('start')
                                        ^^^^^^^^^^^^^^^^^^^^^^
(snip)
```

`ProcessedSource` has `start_with?` method, and `be_start_with` is used as a predicate matcher for it.
  • Loading branch information
koic committed Jan 5, 2024
1 parent 9c4792b commit f9e6682
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions spec/rubocop/ast/processed_source_spec.rb
Expand Up @@ -410,6 +410,7 @@ def some_method
end
end

# rubocop:disable RSpec/RedundantPredicateMatcher
describe '#start_with?' do
context 'with blank source' do
let(:source) { '' }
Expand Down Expand Up @@ -439,6 +440,7 @@ def some_method
end
end
end
# rubocop:enable RSpec/RedundantPredicateMatcher

describe '#preceding_line' do
let(:source) { <<~RUBY }
Expand Down

0 comments on commit f9e6682

Please sign in to comment.