rspec/rspec-core — pull request #804 by myronmarston (2013-02-27 03:28:53+00:00)
Title: Candidate fix for #800

Fix inner/outer subject confusion when using a named subject.

This fixes #800 while preserving the behavior we settled on in #757. However, the complexity of supporting `super` in a named subject (look at that crazy metaprogramming I had to do!) makes me think that we should disable `super` in named subjects altogether instead. @alindeman and I [discussed this previously](https://github.com/rspec/rspec-core/pull/757#issuecomment-11770186) and decided that `super` in a named subject should super to the outer subject, not an outer `let` declaration; however, to prevent the bug reported in #800, we have to make the `let` declaration primary with the subject simply an alias to the `let`...which causes `super` to call the parent `let` method, not the parent subject.

So...I'm thinking of changing this so that it raises a `super() can't be used in a named subject` error instead. Really, I don't think there's a good use case for supporting it. It is a bit of a breaking change (since 2.13.0 is out with `super` calling the parent subject), and we need to get a patch release out to fix #800, so that's a bit of a problem, but I'm not sure what to do about it.