Skip to content

Commit 0d63424

Browse files
committed
Fix specs
It seems that RuboCop comes with certain fixes that improve how RuboCop RSpec works!
1 parent 378b67f commit 0d63424

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

spec/rubocop/cop/rspec/example_wording_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@
192192
context 'when configuration is empty' do
193193
include_examples 'autocorrect',
194194
'it "should have trait" do end',
195-
'it "haves trait" do end'
195+
'it "has trait" do end'
196196

197197
include_examples 'autocorrect',
198198
'it "should only fail" do end',

spec/rubocop/cop/rspec/verified_doubles_spec.rb

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,27 +55,27 @@
5555
end
5656
end
5757

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

67-
context 'when configured to ignore nameless doubles' do
68-
let(:cop_config) { { 'IgnoreNameless' => true } }
69-
70-
it 'ignores doubles that have no name specified' do
71-
expect_no_offenses(<<-RUBY)
61+
it 'flags doubles that have no name specified' do
62+
expect_offense(<<-RUBY)
7263
it do
7364
foo = double
65+
^^^^^^ Prefer using verifying doubles over normal doubles.
7466
end
7567
RUBY
7668
end
7769
end
7870

71+
it 'ignores doubles that have no name specified' do
72+
expect_no_offenses(<<-RUBY)
73+
it do
74+
foo = double
75+
end
76+
RUBY
77+
end
78+
7979
it 'ignores instance_doubles' do
8080
expect_no_offenses(<<-RUBY)
8181
it do

0 commit comments

Comments
 (0)