-
-
Notifications
You must be signed in to change notification settings - Fork 763
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
Proposal: Deprecate let!
#1951
Comments
I don't see that as a misuse,
Additionally we can't do this because |
I agree with @JonRowe. IMO |
Some users like module DisableLetBang
def let!(*args)
raise "let! is not allowed"
end
end
RSpec.configure do |c|
c.extend DisableLetBang
end I don't think it makes sense for us to deprecate it and remove it, as that would create unnecessary work for those who like it and have been using it. Closing. |
Thanks for the feedback! |
let!
seems to be one of the most often mis-used parts of RSpec's syntax.The documentation says that
let
is for a memorised helper method, but very often I see it being used for setting up state, where abefore
block would be much more intention-revealing.For the occasional cases where there is a need to store a reference to the result of the
before
block, a second argument could be passed, for example:Thoughts?
The text was updated successfully, but these errors were encountered: