Skip to content

Files

Latest commit

 

History

History
57 lines (43 loc) · 962 Bytes

RSpec-EmptyLineAfterExample.md

File metadata and controls

57 lines (43 loc) · 962 Bytes

Pattern: Missing empty line after example

Issue: -

Description

Checks if there is an empty line after example blocks.

Examples

# bad
RSpec.describe Foo do
  it 'does this' do
  end
  it 'does that' do
  end
end

# good
RSpec.describe Foo do
  it 'does this' do
  end

  it 'does that' do
  end
end

# fair - it's ok to have non-separated one-liners
RSpec.describe Foo do
  it { one }
  it { two }
end

with AllowConsecutiveOneLiners configuration

# rubocop.yml
# RSpec/EmptyLineAfterExample:
#   AllowConsecutiveOneLiners: false

# bad
RSpec.describe Foo do
  it { one }
  it { two }
end

Configurable attributes

Name Default value Configurable values
AllowConsecutiveOneLiners true Boolean

Further Reading