spec/rubocop/cop/rspec/focus_spec.rb in rubocop-rspec-1.31.0 vs spec/rubocop/cop/rspec/focus_spec.rb in rubocop-rspec-1.32.0
- old
+ new
@@ -8,10 +8,12 @@
^^^^^^^^^^^ Focused spec found.
xit 'test', meta: true, focus: true do; end
^^^^^^^^^^^ Focused spec found.
describe 'test', meta: true, focus: true do; end
^^^^^^^^^^^ Focused spec found.
+ RSpec.describe 'test', meta: true, focus: true do; end
+ ^^^^^^^^^^^ Focused spec found.
it 'test', meta: true, focus: true do; end
^^^^^^^^^^^ Focused spec found.
xspecify 'test', meta: true, focus: true do; end
^^^^^^^^^^^ Focused spec found.
specify 'test', meta: true, focus: true do; end
@@ -59,10 +61,12 @@
^^^^^^ Focused spec found.
scenario 'test', :focus do; end
^^^^^^ Focused spec found.
describe 'test', :focus do; end
^^^^^^ Focused spec found.
+ RSpec.describe 'test', :focus do; end
+ ^^^^^^ Focused spec found.
xit 'test', :focus do; end
^^^^^^ Focused spec found.
context 'test', :focus do; end
^^^^^^ Focused spec found.
xcontext 'test', :focus do; end
@@ -106,14 +110,17 @@
some_method "foo", focus: true do
end
RUBY
end
+ # rubocop:disable RSpec/ExampleLength
it 'flags focused block types' do
expect_offense(<<-RUBY)
fdescribe 'test' do; end
^^^^^^^^^^^^^^^^ Focused spec found.
+ RSpec.fdescribe 'test' do; end
+ ^^^^^^^^^^^^^^^^^^^^^^ Focused spec found.
ffeature 'test' do; end
^^^^^^^^^^^^^^^ Focused spec found.
fcontext 'test' do; end
^^^^^^^^^^^^^^^ Focused spec found.
fit 'test' do; end
@@ -126,6 +133,7 @@
^^^^^^^^^^^^^^^ Focused spec found.
focus 'test' do; end
^^^^^^^^^^^^ Focused spec found.
RUBY
end
+ # rubocop:enable RSpec/ExampleLength
end