Skip to content

Files

Latest commit

 

History

History
42 lines (31 loc) · 905 Bytes

RSpec-ExampleLength.md

File metadata and controls

42 lines (31 loc) · 905 Bytes

Pattern: Long example

Issue: -

Description

Checks for long examples.

A long example is usually more difficult to understand. Consider extracting out some behavior, e.g. with a let block, or a helper method.

Examples

# bad
it do
  service = described_class.new
  more_setup
  more_setup
  result = service.call
  expect(result).to be(true)
end

# good
it do
  service = described_class.new
  result = service.call
  expect(result).to be(true)
end

Configurable attributes

Name Default value Configurable values
Max 5 Integer

Further Reading