Pattern: Inconsistent style when matching nil
Issue: -
Ensures a consistent style is used when matching nil
.
You can either use the more specific be_nil
matcher, or the more
generic be
matcher with a nil
argument.
This rule can be configured using the EnforcedStyle
option
# bad
expect(foo).to be(nil)
# good
expect(foo).to be_nil
# bad
expect(foo).to be_nil
# good
expect(foo).to be(nil)
Name | Default value | Configurable values |
---|---|---|
EnforcedStyle | be_nil |
be , be_nil |