Skip to Main Content
Rails 5 Test Prescriptions
book

Rails 5 Test Prescriptions

by Noel Rappin
February 2018
Intermediate to advanced content levelIntermediate to advanced
406 pages
9h 52m
English
Pragmatic Bookshelf
Content preview from Rails 5 Test Prescriptions

Find the Seam

Test doubles are a specific version of a more general technique for working with legacy code, which involves finding seams in the code and exploiting them to make testing the legacy functionality possible

A seam is a place where you can change your application’s behavior without changing the code. A test double acts as a seam because adding the test double, which happens in the test, changes the behavior of the code by mandating a specific response to a method call without executing the method. Again, the behavior of the method under test changes in the test environment without affecting behavior in production and without changing the existing development code.

It sounds magical, but the basic idea is simple and Ruby makes it easy ...

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

Rails 4 Test Prescriptions

Rails 4 Test Prescriptions

Noel Rappin
Agile Web Development with Rails 5.1

Agile Web Development with Rails 5.1

Sam Ruby, David B. Copeland, Dave Thomas
Rspec Essentials

Rspec Essentials

Mani Tadayon

Publisher Resources

ISBN: 9781680505566Errata Page