O'Reilly logo

Effective Testing with RSpec 3 by Myron Marston, Ian Dees

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Ensuring the Application Works for Real

There’s one last thing to try before we call it a day. Your specs provide evidence that the application works, but they certainly don’t provide proof. Let’s try running the app by hand (as we did at the end of Saving Your Progress: Pending Specs) to see for ourselves whether or not it really works. First, boot up the app using the rackup command:

 $ ​​bundle​​ ​​exec​​ ​​rackup
 [2017-06-13 13:34:47] INFO WEBrick 1.3.1
 [2017-06-13 13:34:47] INFO ruby 2.4.1 (2017-03-22) [x86_64-darwin15]
 [2017-06-13 13:34:47] INFO WEBrick::HTTPServer​#start: pid=45899 port=9292

With your API server running, try hitting the application’s HTTP endpoint from another terminal:

 $ ​​curl localhost:9292/expenses/2017-06-10 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required