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:
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?
capybara uses an ad-hoc Rack server for its specs:
Any Rack app (including Rails applications) can be served using this system, though the Rails configuration might get a bit tricky.