Skip to content

Commit a02d20d

Browse files
author
rito.ishihara
committed
Fix Separate test cases for RSpec/ChangeByZero cop
These examples were incorrectly grouped under "by is not zero" test cases despite testing different behavior.
1 parent 45aad87 commit a02d20d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spec/rubocop/cop/rspec/change_by_zero_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,10 +365,11 @@
365365
expect { foo }.to change { Foo.bar }.by(1)
366366
end
367367
RUBY
368+
end
368369

370+
it 'does not register an offense when without expect block' do
369371
expect_no_offenses(<<~RUBY)
370372
it do
371-
subject; change(Foo, :bar).by(0)
372373
change(foo, :bar).by(0)
373374
end
374375
RUBY

0 commit comments

Comments
 (0)