rubocop-rspec icon indicating copy to clipboard operation
rubocop-rspec copied to clipboard

Cop idea: no context for single `it` block

Open mockdeep opened this issue 7 years ago • 6 comments

One thing we try to do, when we remember, is to collapse context descriptions when there is a single it block:

# bad
context 'when this thing' do
  it 'does something'
end

# good
it 'does something when this thing' do
end

# also okay
context 'when this thing' do
  it 'does something'
  it 'does something else'
end

mockdeep avatar Aug 10 '16 16:08 mockdeep