Out-of-Process Testing of Any REST API

In the previous section, we tested a REST API by running Cucumber in the same Ruby process as our application. In this section, we are going to explore how to test a REST API when Cucumber is running in a different process than the application. Figure 14, Testing an out-of process web application with Cucumber illustrates how this fits together. Cucumber and the HTTP Client library run in one process, and the web application (the dotted boxes) runs in another. We’ll be using the same application that we created in the previous section, but you could just as well use an application written in a different programming language. This is thanks to a handy little library called HTTParty, which can issue HTTP ...

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.