What We Just Learned

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, completely 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 ...

Get The Cucumber Book now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.