Skip to content

Files

Latest commit

 

History

History
23 lines (15 loc) · 464 Bytes

Minitest-AssertIncludes.md

File metadata and controls

23 lines (15 loc) · 464 Bytes

Pattern: Missing use of assert_includes

Issue: -

Description

Enforces the test to use assert_includes instead of using assert(collection.include?(object)).

Examples

# bad
assert(collection.include?(object))
assert(collection.include?(object), 'message')

# good
assert_includes(collection, object)
assert_includes(collection, object, 'message')

Further Reading