Intridea Blog: Technology, Design, Business

Back to Blog

Get in Touch

You're currently viewing posts tagged with: "tip"

Hunting Down Execution Order Test Failures

By Jerry Cheung | January 11, 2012 rails, ruby, tests, tip
Medium

Unit tests should pass when run in random order. But for an existing legacy project, certain tests might depend on the execution order. One test might run perfectly fine by itself, but fail miserably when run after another test. Rather than running different combinations manually, RSpec 2.8 has the option to run specs in random order with the --order random flag. But even with this, it can be hard to determine which specific test is causing the dependency. For example:

Read more…