Skip to content

Let methods called in before :all are cached for all examples including nested

gitlab-qa-bot requested to merge github/fork/adzap/master into master

Created by: adzap

If you call a let method in a before :all, the @__memoized ivar is stored and set in all examples. This mostly becomes a problem when you have a nested group with a let of the same name which defines it. In this case it cannot change the value as the @__memoized ivar from the before :all is already initialized.

The commit includes the failing specs and extra one for completeness on the let_spec.rb.

I have added the filter for the @__memoized ivar as a config option. I don't know whether this is overkill. Can be convinced to just use a static string comparison also.

Thanks Adam

Merge request reports