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 practiced several good testing habits related to running your specs. RSpec’s support for these habits sets it apart from other test frameworks:

  • Powerful formatters show your specs’ output in a variety of ways.

  • Filtering your examples lets you focus on a specific issue and run just the specs you need.

  • The pending method helps you sketch out examples before implementing the behavior fully.

Now, you’re going to experiment with these techniques a little further.

Exercise

In a new directory, create a file called spec/tea_spec.rb with the following contents:

 class​ Tea
 end
 
 RSpec.configure ​do​ |config|
  config.example_status_persistence_file_path = ​'spec/examples.txt' ...

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