O'Reilly logo

Effective Testing with RSpec 3 by Myron Marston, Ian Dees

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Your Turn

In this chapter, you’ve clarified exactly how your API is supposed to behave. You’ve spelled out what happens when storing an expense record succeeds or fails, using a test double to stand in for the unwritten persistence layer. You’ve refactored your specs so that they spell out exactly what behavior you’re testing. Finally, you’ve used the design suggested by your tests to guide the interface of a real object.

Now, it’s time to put these new skills to the test. Don’t skip this one; you’re going to build on this work in the next chapter.

Exercises

In these exercises, you’re going to implement another key piece of your application at the routing layer. Along the way, you’ll be looking for opportunities to share code.

Reducing Duplication ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required