Skip to Main Content
Cucumber Recipes
book

Cucumber Recipes

by Ian Dees, Matt Wynne, Aslak Hellesoy
February 2013
Intermediate to advanced content levelIntermediate to advanced
272 pages
5h 45m
English
Pragmatic Bookshelf
Content preview from Cucumber Recipes
Recipe 34Play Back Canned Network Data Using VCR

Problem

You’re testing an app that relies on one or more third-party, HTTP-based APIs. You’re worried about what will happen to your test results if one of the APIs you use times out or starts returning different data than what you expected.

Ingredients

  • VCR,[220] a library that can record a live HTTP interaction and then play it back during testing

  • WebMock[221] for simulating web traffic

Solution

Before we start writing the code for this recipe, let’s talk about application styles. There’s a whole class of apps whose usefulness comes from the way they tie together data sources from around the Web. Consider, for instance, the Influence Explorer civic project from Sunlight Labs.[222] This site ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Cucumber Cookbook

Cucumber Cookbook

Shankar Garg
Basiswissen Softwaretest , 6th Edition

Basiswissen Softwaretest , 6th Edition

Andreas Spillner, Tilo Linz
React Cookbook

React Cookbook

David Griffiths, Dawn Griffiths

Publisher Resources

ISBN: 9781941222607Errata