When testing a REST web service with Cucumber, it’s generally preferable to run Cucumber in-process—in the same process as your application. In this chapter, we covered the two main approaches—in-process and out-of-process. Although our example used the Sinatra web framework, the techniques used in this chapter can be applied to other web frameworks too.
Rack-based applications such as Ruby on Rails and Sinatra can be tested in-process using Rack-Test, bypassing HTTP, making them fast.
Non-Rack-based applications run in a separate process from Cucumber and have to be started before Cucumber runs.
You can use indented JSON documents in your scenarios, as long as you ignore whitespace when you compare them to documents ...