Throughout this book, you’ve run your spec suite via the rspec command. But there’s another common way to run your specs: using the Rake build tool. The rspec-core gem ships with an easy-to-configure Rake task. To enable it, add the following two lines to your project’s Rakefile:
This snippet defines a simple spec task that will run rspec with your configured defaults. You can then run it like so:
|||$ rake spec|
Running RSpec this way adds some overhead. It takes time to load Rake itself, plus any libraries you need for other tasks in your Rakefile. A canned Rake task is also less flexible than the rspec command, ...