Skip to content

Files

Latest commit

 

History

History
41 lines (28 loc) · 799 Bytes

RSpec-LetBeforeExamples.md

File metadata and controls

41 lines (28 loc) · 799 Bytes

Pattern: Use of let after example

Issue: -

Description

Checks for let definitions that come after an example.

Examples

# Bad
let(:foo) { bar }

it 'checks what foo does' do
  expect(foo).to be
end

let(:some) { other }

it 'checks what some does' do
  expect(some).to be
end

# Good
let(:foo) { bar }
let(:some) { other }

it 'checks what foo does' do
  expect(foo).to be
end

it 'checks what some does' do
  expect(some).to be
end

Further Reading