Skip to content

Latest commit

 

History

History
28 lines (19 loc) · 731 Bytes

RSpec-Be.md

File metadata and controls

28 lines (19 loc) · 731 Bytes

Pattern: Use of be without argument

Issue: -

Description

Checks for expectations where be is used without argument.

The be matcher is too generic, as it pass on everything that is not nil or false. If that is the exact intend, use be_truthy. In all other cases it's better to specify what exactly is the expected value.

Examples

# bad
expect(foo).to be

# good
expect(foo).to be_truthy
expect(foo).to be 1.0
expect(foo).to be(true)

Further Reading