rubocop / rubocop-rspec

Code style checking for RSpec files.

Home Page:https://docs.rubocop.org/rubocop-rspec

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RSpec/ExampleWording: autocorrect "it will" (future tense) to the present tense

jdufresne opened this issue · comments

From https://rspec.rubystyle.guide/#should-in-example-docstrings

The descriptions represent actual functionality, not what might be happening. Use the third person in the present tense.

However, I sometimes see examples written in the future tense:

it 'will return nil'

it 'will not return nil'

Just like misusing "should", this could emit an offense or be autocorrected to the present tense:

it 'returns nil'

it 'does not return nil'