Take the 2-minute tour ×

My application to run properly using faye, redis, resque and other services, that I am starting every time with foreman. Now I am writing acceptance tests(with capybara+rspec) and i wonder how could I start foreman(or even a faye alone) (with capybara in spec_helper) to test live features. Thanks in advice.

share|improve this question

2 Answers 2

up vote 0 down vote accepted

One option is to not depend on these services in your tests. I know redis and resque have "mock" counterparts that behave like these services without actually needing to run them. Some services might not have a "mock" version (I can't find one for Faye), so you may just need to run them in the background.

share|improve this answer
Thanks for answer, I need to run only faye for now, but it need to be started with acceptance tests, not manually, is there option how to do this in spec_helper? –  Rustam A. Gasanov Aug 8 '12 at 12:27
You can execute system commends from ruby using either backticks (`start service`) or %x[start service]. I would create a rake task that starts the service and then runs all your specs, and stops the service at the end. –  Beerlington Aug 8 '12 at 12:50
you could also have it on the cloud... –  Ismael Abreu Aug 8 '12 at 16:14

if you are using jenkins as the CI server, you can start the foreman before rspec started.

share|improve this answer

Your Answer


