Pattern: Example without description
Issue: -
Checks for examples without a description.
RSpec allows for auto-generated example descriptions when there is no description provided or the description is an empty one.
This rule removes empty descriptions. It also defines whether auto-generated description is allowed, based on the configured style. This rule can be configured using the EnforcedStyle
option
# bad
it('') { is_expected.to be_good }
it '' do
result = service.call
expect(result).to be(true)
end
# good
it { is_expected.to be_good }
it do
result = service.call
expect(result).to be(true)
end
# bad
it('') { is_expected.to be_good }
it do
result = service.call
expect(result).to be(true)
end
# good
it { is_expected.to be_good }
# bad
it { is_expected.to be_good }
it do
result = service.call
expect(result).to be(true)
end
Name | Default value | Configurable values |
---|---|---|
EnforcedStyle | always_allow |
always_allow , single_line_only , disallow |