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' ...

Get Effective Testing with RSpec 3 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.