Skip to content

Files

Latest commit

 

History

History
24 lines (16 loc) · 413 Bytes

Minitest-AssertPredicate.md

File metadata and controls

24 lines (16 loc) · 413 Bytes

Pattern: Missing use of assert_predicate

Issue: -

Description

Enforces the test to use assert_predicate instead of using assert(obj.a_predicate_method?).

Examples

# bad
assert(obj.one?)
assert(obj.one?, 'message')

# good
assert_predicate(obj, :one?)
assert_predicate(obj, :one?, 'message')

Further Reading