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, we took a second look at the main ways to structure your examples into groups. You saw how important it is to take the time to get the words right, and use terms in your specs like context or specify where they make more sense than describe or it.

We also dove into ways to move duplicated setup code out of your specs: let definitions, hooks, and helper methods. Although we’ve had brief encounters with these techniques in prior chapters, you saw how to get the most out of them here.

Finally, we talked about how to share examples or entire contexts. Now, it’s time to bring these techniques to bear on your own code.

Exercise

In this exercise, you’ve inherited specs for two different URI parsers. The implementations have ...

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