- 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.
...even if an error occurs in before(:all). Fixes #558.
…ject. I did this for #describe in de01e05 but didn't notice that the shared example/context definition methods have the same issue.
…lock. - Closes #615.
* Fix specs. The `should_receive(:message).with(/.../)` wasn't working as expected...it passed even if the message text didn't match the regex. I figured out that it was because of the fact that the error was being raised within the example-under-test, which already had two errors and was simply printing (or, previously, silencing) the extra error. The solution is to capture the reported message using a stub implementation, and then assert on it after running the example. * The added context ("in an after hook") for 2nd errors happening in an after hook wasn't being included in the printed message. This is fixed now.
Also did some minor refactoring in order to be able to use Yard to document internal-DSL-generated methods like `it`, `example`, and `specify`.
- Provides support for rspec/rspec-rails#391. - Also refactored the hooks infrastructure such that most of the work is done within the hooks module rather than spreading it out across its different consumers.
…if :pending => true) - defaults to 'No reason given' if :pending => true - change default pending message to 'No reason given' - assign 'Not yet implemented' when no block passed to example (a.k.a. it/specify) - Closes #540
…ing describes for now)
…hods (more descriptive) - also add more rdoc