[rspec-users] Control order of spec files for an integration test?

Wolfram Arnold, RubyFocus wolfram at rubyfocus.biz
Thu Feb 10 15:19:55 EST 2011


Hi,

I'm using RSpec2 with Capybara and Celerity for an integration test.
I'd like to use some of the tests (e.g. user registration) to run as a
prerequisite to other steps.  I was hoping that by naming files in the
correct alphabetical order, RSpec would run them in alphabetical
order.  RSpec 1.x used to do that, I believe, and also supported a --
loadby flag.

Background:
I realize that test dependency is usually considered a bug in general
TDD methodology and I wholeheartedly agree to this for standard test
coverage (models, controllers, etc...).  Our (emerging) integration
framework is a stand-alone application that pings live (staging)
servers and is a sort of sanity check. Our full environment involves
multiple servers that communicate over API's, and our design goal with
the sanity check suite is to go as close to the user perspective as
possible, and bridge gaps in test coverage that is caused by mocking
out remote API's.

Our sanity suite is actually designed to have some steps build on top
of each other and some are expensive (i.e. slow) to run and also
involve outside resources (e.g. credit card gateways) that we don't
want to over-burden by repeating setup for each example.

My actual question is to find out if there is anything that would
speak against patching RSpec so that it supports file ordering per
command line flags or options configuration.

Thanks,

Wolf


More information about the rspec-users mailing list