rspec/rspec-core — pull request #823 by myronmarston (2013-03-09 03:44:10+00:00)
Title: Revise before(:all)/let behavior based on feedback from @dchelimsky.

- This is closer to the behavior we've had in 2.12 and earlier. `let`
declarations that are accessed in `before(:all)` will preserve their
memoized value for all examples in the group.
- On 2.12 and earlier, this would cause additional `let` declarations
that were not accessed in `before(:all)` but were accessed in individual
examples to "leak", because the same `__@memoized` ivar got shared
with each example in the group, and would be mutated each time an
additional `let` declaration was accessed. This commit changes
that behavior. The fact that one `let` declaration is accessed in
`before(:all)` does not affect the lifecycle of other `let` declarations
in any way.

This is in place of #821. I plan for this to be the solution both for the upcoming 2.13.1 patch release and for all subsequent 2.x releases. In 3.0 we'll disable accessing `let` or `subject` declarations from `before(:all)` entirely.

/cc @alindeman