DEV Community

Discussion on: A Fixture-Based Approach to Interface Testing in Rails

Collapse
 
martinstreicher profile image
Martin Streicher

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.

Thread Thread
 
nepalez profile image
Andrew Kozin

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.

Thread Thread
 
martinstreicher profile image
Martin Streicher

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.