rspec/rspec-core — Issue #500: If any let method is invoked from before(:all), all let values are shared across all examples
Author: rsutphin
Created: 2011-11-10 05:37:39+00:00
State: open

If you invoke any `let`-defined method from a `before(:all)` block, all `let` values will be shared across all examples. [A sample][gist]. This case is not specified one way or the other in the documentation, but the observed behavior is a bit surprising. I think a less surprising behavior would be for the `let`s to be memoized separately for `before(:all)`.

This behavior occurs in all RSpec 2.x versions (I tested all the way back to 2.0.1 and up to 2.8.0.rc1), but I can find no mention of it in the mailing list or via google, so I guess that it doesn't come up too often.

[gist]: https://gist.github.com/1354150