I'm writing a library to wrap tsung's functionality in a way that can be better used by rails applications. I want to write some integration tests that boil down to the following:
- launch a simple web server
- run tsung-recorder via the library
- launch selenium, with a firefox profile configured to use the tsung proxy, and have this fetch a page from the server launched in step 1
- examine the recorded library (it exists, it's in the correct location, etc.)
For step 1, while I could launch a vanilla rails app externally (e.g., %x{rails s}
), I'm pretty sure there's a better way to programmatically create a simple web server suitable for testing.
tl;dr - What's a way to programmatically launch a simple web server inside a test?