That's the one that recommends using "let" everywhere, which is actively discouraged by RSpec documentation, which specifically states there should be at most 2 or 3 lets (sparingly)
And it suggests using let (instead of the better let!) which when chained makes the execution of the code incredibly unpredictable for a human.
I suggest sticking only to instance variables and before blocks, so that overriding lets is not a practice that appear in your system and also won't push you toward abstracting your tests too much in an effort to improve performance
Where does it say use let everywhere? I see only one section that explains let vs. let! and it makes no preference for the former: https://www.betterspecs.org/#let
> When you have to assign a variable instead of using a before block to create an instance variable, use let. Using let the variable lazy loads only when it is used the first time in the test and get cached until that specific test is finished. A really good and deep description of what let does can be found in this stackoverflow answer.
It omits entirely the warning and says "use this when assigning variable". Yeah you can make an argument either way, but given how dogmatic this website is, it's literally pushing toward using let.
The consequence is that you get tests written with let everywhere.
I would outright say do NOT use let, like at all, your tests will be better without them:
- A test abstraction could live in the actual code so that it's properly tested, it's plain ruby and can be used by other developers wanting to test code related to yours
- A test will have all the setup close to its execution phase, making it easier to read
- Instance variables override don't exist
If you do, why? How is it better in your view?