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.
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.
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.