[rspec-users] HOWTO: Background tasks during test (ugly)

Ashley Moran ashley.moran at patchspace.co.uk
Thu Oct 29 06:22:12 EDT 2009

On Oct 29, 2009, at 3:09 am, Student wrote:

> I am writing a script that reads connection information from a config
> file, and based, on what it finds, connects to multiple mysql servers
> and performs tasks.  To test this script, I need to set up test
> servers, but getting them running without causing the tests to be
> rerun when they stop is a bit..tricky.  I cannot say that I'm proud of
> it, but here is how I did it:

Is this because of autospec?  If so, you can modify the files autotest  
watches.  Or, you could do the server stuff in a tmpdir[1] directory.

Let me know if I'm off-target - I can't see the definition of  
`datadir` in your snippet.


[1] http://www.ruby-forum.com/topic/169054


More information about the rspec-users mailing list