This repository was archived by the owner on Nov 30, 2024. It is now read-only.
This repository was archived by the owner on Nov 30, 2024. It is now read-only.
let! and subject! ordering #1021
Closed
Description
It would be nice to have a feature/documentation for the ordering of let!
and subject!
since it can make a difference.
Personally, I'd prefer they were run last; after all before
blocks and before the example.
e.g.
Scenario: subject bang runs after all before blocks at latest
Given a file named "subject_bang_last_spec.rb" with:
"""ruby
describe "subject! runs last" do
subject! { array.count }
let(:array) { [] }
before { array.push 1 }
describe "nesting group" do
before { array.push 2 }
it { should eq(2) }
end
end
"""
When I run `rspec subject_bang_last_spec.rb`
Then the examples should all pass
It looks like, however, they are run first.
Ciao!
Metadata
Metadata
Assignees
Labels
No labels