Skip to content

Commit 58a98b3

Browse files
dgollahonbquorning
authored andcommitted
Add pending examples to what Focus cop can detect
- Pending examples are also capable of being focused so I've added them to the examples that are searched for.
1 parent f5dbe20 commit 58a98b3

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/rubocop/cop/rspec/focus.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ class Focus < Cop
2626
ExampleGroups::GROUPS +
2727
ExampleGroups::SKIPPED +
2828
Examples::EXAMPLES +
29-
Examples::SKIPPED
29+
Examples::SKIPPED +
30+
Examples::PENDING
3031

3132
focused = ExampleGroups::FOCUSED + Examples::FOCUSED
3233

spec/rubocop/cop/rspec/focus_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
^^^^^^^^^^^ Focused spec found.
3939
xscenario 'test', meta: true, focus: true do; end
4040
^^^^^^^^^^^ Focused spec found.
41+
pending 'test', meta: true, focus: true do; end
42+
^^^^^^^^^^^ Focused spec found.
4143
RUBY
4244
end
4345

@@ -75,6 +77,8 @@
7577
^^^^^^ Focused spec found.
7678
it 'test', :focus do; end
7779
^^^^^^ Focused spec found.
80+
pending 'test', :focus do; end
81+
^^^^^^ Focused spec found.
7882
RUBY
7983
end
8084
# rubocop:enable RSpec/ExampleLength

0 commit comments

Comments
 (0)