Within a describe block trying to def a method returns can't declare def dynamically. I searched the source code for spec testing on defining methods in rspec style with let and it doesn't exist.
What's the rule, or standardized way to do this in spec tests?
The current approach is to have private def in the _spec.cr file. So they don't collide with other defs in other files. But they are global in the _spec.cr without contextual information. That is a current limitation of the built in spec.
Closing. Using private def is the way to go for now (and I think forever)
Most helpful comment
The current approach is to have
private defin the_spec.crfile. So they don't collide with other defs in other files. But they are global in the_spec.crwithout contextual information. That is a current limitation of the built in spec.