views:

74

answers:

1

How do you run rots in a Rails integration test? I can run rots from the command line, should I run the command from Ruby or is there a method I can call to get it to run?

A: 

I think it's best to start rots in before(:all) block (for rspec) or def setup method (for test unit) and stop it in after(:all)/def teardown block/method respectively.

To start rots you probably should use something like:

rots = IO.popen("rots")

and then to stop it:

rots.close

but be aware this code is not tested.

Eimantas
Do you mean `rots`? That seems to block until rots exit, so it never leaves the setup. What am I missing?
J. Pablo Fernández
The backticks were removed from around rots in my comment.
J. Pablo Fernández
Eimantas