[rspec-users] Testing an API I'm creating, need test server to be running

David Chelimsky dchelimsky at gmail.com
Sat Jan 14 11:32:58 EST 2012


On Jan 14, 2012, at 8:40 AM, apneadiving wrote:

> As I am writing a brand new API, I'd like to test it's response.
<snip/>
> Basically, it would be great in my case to test if ActiveResource gets
> the expected data but it means I have to launch a test server in
> background for the whole suite.
<snip/>
> Is there a convenient to handle this? Currently, I launch the test
> server in console but it would be much better to have this handled
> programmatically.

I'd recommend you check out https://github.com/brynary/rack-test. It provides access to attributes of the request and the response object, and obviates the need for running a server. Take a look at its specs: https://github.com/brynary/rack-test/blob/master/spec/rack/test_spec.rb.

HTH,
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20120114/28bbd2a7/attachment.html>


More information about the rspec-users mailing list