Skip to content

Files

Latest commit

 

History

History
24 lines (16 loc) · 570 Bytes

RSpec-ImplicitBlockExpectation.md

File metadata and controls

24 lines (16 loc) · 570 Bytes

Pattern: Implicit block expectation

Issue: -

Description

Checks that implicit block expectation syntax is not used. Prefer using explicit block expectations.

Examples

# bad
subject { -> { do_something } }
it { is_expected.to change(something).to(new_value) }

# good
it 'changes something to a new value' do
  expect { do_something }.to change(something).to(new_value)
end

Further Reading