KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I tend to use before blocks to set instance variables. I then use those variables across my examples. I recently came upon let() . According to RSpec docs, it is used to ... to define a memoized helper method. The value will be cached across multiple calls in the same example but not across examples. How is this different from using instance variables in before blocks? And also when should you use let() vs before {} ?
Tags (comma-separated)
Save Edits
Cancel