Skip to content

Commit 39a9d89

Browse files
authored
Merge pull request #2060 from rubocop/fix-false-positive-in-rspec-pending
2 parents 929d9e6 + 7c117ee commit 39a9d89

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Master (Unreleased)
44

5+
- Fix false positive in `RSpec/Pending`, where it would mark the default block `it` as an offense. ([@bquorning])
6+
57
## 3.5.0 (2025-02-16)
68

79
- Don't let `RSpec/PredicateMatcher` replace `respond_to?` with two arguments with the RSpec `respond_to` matcher. ([@bquorning])

lib/rubocop/cop/rspec/pending.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class Pending < Base
4747

4848
# @!method skippable_example?(node)
4949
def_node_matcher :skippable_example?, <<~PATTERN
50-
(send nil? #Examples.regular ...)
50+
(send nil? #Examples.regular _ ...)
5151
PATTERN
5252

5353
# @!method pending_block?(node)

spec/rubocop/cop/rspec/pending_spec.rb

+8
Original file line numberDiff line numberDiff line change
@@ -225,4 +225,12 @@
225225
subject { Project.pending }
226226
RUBY
227227
end
228+
229+
it 'ignores default block parameter' do
230+
expect_no_offenses(<<~RUBY)
231+
expect(
232+
foo.map { it.reverse }
233+
).to include(:bar)
234+
RUBY
235+
end
228236
end

0 commit comments

Comments
 (0)