Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear let/subject memoization when referenced in before(:all). #811

Merged
merged 1 commit into from Mar 2, 2013

Conversation

myronmarston
Copy link
Member

Fixes #802.

myronmarston added a commit that referenced this pull request Mar 2, 2013
Clear let/subject memoization when referenced in before(:all).
@myronmarston myronmarston merged commit f071280 into master Mar 2, 2013
@myronmarston myronmarston deleted the let_before_all branch March 2, 2013 07:42
def self.warn_about_unsound_let_usage(let_hash)
called_lets = let_hash.keys.map { |l| "`#{l}`" }.join(' and ')

::RSpec.warn_deprecation "WARNING: let declaration(s) #{called_lets} referenced " +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to see this reference the line on which the before(:all) hook is declared. Also, not sure if this is already the case, but once per group (rather than once per example) would be nice.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback. I wanted to get a backtrace line in this message but couldn't think of a simple way to do that. Thinking about it some more, I've come up with a different approach that'll make that easy. I'll try to put up a PR later today with that fix.

myronmarston added a commit that referenced this pull request Mar 9, 2013
yujinakayama pushed a commit to yujinakayama/rspec-monorepo that referenced this pull request Oct 6, 2021
Clear let/subject memoization when referenced in before(:all).

---
This commit was imported from rspec/rspec-core@f071280.
yujinakayama pushed a commit to yujinakayama/rspec-monorepo that referenced this pull request Oct 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

subject { } is broken in rspec 2.13.x when before(:all) references a let declaration
2 participants