Thanks. And since the stubbing happens in a before (I assume :each) the stubs are reset each time and persist only in the current context.
before
:each
Exactly!
The only reason to split fixtures is arranging them in a more readable manner. Personally, I prefer just to copy-paste the whole fixture for every single case and see no reason in DRY-ing them.
But I can imagine cases when splitting worths it.
Thanks for the reply. I suppose you can use the alias feature of YAML to share sections of the configuration, at least within the same file.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks. And since the stubbing happens in a
before
(I assume:each
) the stubs are reset each time and persist only in the current context.Exactly!
The only reason to split fixtures is arranging them in a more readable manner. Personally, I prefer just to copy-paste the whole fixture for every single case and see no reason in DRY-ing them.
But I can imagine cases when splitting worths it.
Thanks for the reply. I suppose you can use the alias feature of YAML to share sections of the configuration, at least within the same file.