Skip to content

Commit 9fd6d66

Browse files
authored
Merge pull request #1788 from G-Rath/add-missing-tests
test: add missing cases for "include" matchers
2 parents bab0427 + 6906bad commit 9fd6d66

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

spec/rubocop/cop/rspec_rails/minitest_assertions_spec.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,23 @@
251251
refute_includes a, b
252252
^^^^^^^^^^^^^^^^^^^^ Use `expect(a).not_to include(b)`.
253253
RUBY
254+
255+
expect_correction(<<~RUBY)
256+
expect(a).not_to include(b)
257+
RUBY
258+
end
259+
260+
it 'does not register an offense when using `expect(a).to include(b)`' do
261+
expect_no_offenses(<<~RUBY)
262+
expect(a).to include(b)
263+
RUBY
264+
end
265+
266+
it 'does not register an offense when ' \
267+
'using `expect(a).not_to include(b)`' do
268+
expect_no_offenses(<<~RUBY)
269+
expect(a).not_to include(b)
270+
RUBY
254271
end
255272
end
256273

0 commit comments

Comments
 (0)