Skip to content

Commit

Permalink
Fix specs
Browse files Browse the repository at this point in the history
It seems that RuboCop comes with certain fixes that improve how RuboCop
RSpec works!
  • Loading branch information
pirj committed May 21, 2020
1 parent 378b67f commit 0d63424
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion spec/rubocop/cop/rspec/example_wording_spec.rb
Expand Up @@ -192,7 +192,7 @@
context 'when configuration is empty' do
include_examples 'autocorrect',
'it "should have trait" do end',
'it "haves trait" do end'
'it "has trait" do end'

include_examples 'autocorrect',
'it "should only fail" do end',
Expand Down
26 changes: 13 additions & 13 deletions spec/rubocop/cop/rspec/verified_doubles_spec.rb
Expand Up @@ -55,27 +55,27 @@
end
end

it 'doubles that have no name specified' do
expect_offense(<<-RUBY)
it do
foo = double
^^^^^^ Prefer using verifying doubles over normal doubles.
end
RUBY
end
context 'when configured not to ignore nameless doubles' do
let(:cop_config) { { 'IgnoreNameless' => false } }

context 'when configured to ignore nameless doubles' do
let(:cop_config) { { 'IgnoreNameless' => true } }

it 'ignores doubles that have no name specified' do
expect_no_offenses(<<-RUBY)
it 'flags doubles that have no name specified' do
expect_offense(<<-RUBY)
it do
foo = double
^^^^^^ Prefer using verifying doubles over normal doubles.
end
RUBY
end
end

it 'ignores doubles that have no name specified' do
expect_no_offenses(<<-RUBY)
it do
foo = double
end
RUBY
end

it 'ignores instance_doubles' do
expect_no_offenses(<<-RUBY)
it do
Expand Down

0 comments on commit 0d63424

Please sign in to comment.