Skip to content

Better fix for let definitions eagerly included

Created by: myronmarston

This is an alternate fix for #908. It changes when the LetDefinitions module gets included (delaying it until after configuration has included its modules and the group block has been eval'd) so that its method definitions take precedence when there is a naming collision. The tricky parts were:

  • implicit subject -- I had to refactor this to not use subject as module inclusion time.
  • SharedContext -- I rewrote this to use a simpler record/playback mechanism so that all it really does is store stuff that's eval'd on the example group when included.

@alindeman / @JonRowe -- thoughts?

BTW, the diff is a bit obfuscated by the fact that this includes a reversion of #937. If you want to see just the diff from what we originally had, you can see it here:

https://github.com/rspec/rspec-core/compare/bbc83cee645ddd44049b31960ed9f914a0884691...better-fix-for-let-definitions-eagerly-included

Merge request reports