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

Code Snippets

We have provided code snippets throughout the book that show how RSpec is used in real-world situations. Most of these examples are intended for you to follow along with on your computer, particularly those in Part I and Part II.

A typical snippet will contain one or more lines of Ruby code meant for you to type into your text editor so that you can run them later. Here is an example:

 puts ​"You can type me in; it's okay!"

We’ll show each code file a few lines at a time. If you need more context for any given snippet, you can click the filename banner (in the eBook) or open the book’s source code (linked at the end of this chapter) to view the entire file at once.

Some code examples have no banner; ...

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