In the examples in this chapter, we’ve always run all the specs together. On a real project, you don’t necessarily want to load your entire test suite every time you invoke RSpec.
If you’re diagnosing a specific failure, for instance, you’ll want to run just that one example. If you’re trying to get rapid feedback on your design, you can bypass slow or unrelated specs.
The easiest way to narrow down your test run is to pass a list of file or directory names to rspec:
|||$ rspec spec/unit # Load *_spec.rb in this dir and subdirs|
|||$ rspec spec/unit/specific_spec.rb # Load just one spec file|
|||$ rspec spec/unit spec/smoke # Load more than one directory|
|||$ rspec spec/unit spec/foo_spec.rb ...|