Skip to content

Files

Latest commit

 

History

History
45 lines (32 loc) · 1.01 KB

RSpec-ExampleWording.md

File metadata and controls

45 lines (32 loc) · 1.01 KB

Pattern: Malformed example description

Issue: -

Description

Checks for common mistakes in example descriptions.

This rule will correct docstrings that begin with 'should' and 'it'.

The autocorrect is experimental - use with care! It can be configured with CustomTransform (e.g. have => has) and IgnoredWords (e.g. only).

Examples

# bad
it 'should find nothing' do
end

# good
it 'finds nothing' do
end
# bad
it 'it does things' do
end

# good
it 'does things' do
end

Configurable attributes

Name Default value Configurable values
CustomTransform {"be"=>"is", "BE"=>"IS", "have"=>"has", "HAVE"=>"HAS"}
IgnoredWords [] Array

Further Reading