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
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users