This is the first time I tried to run my Rspec tests as a rake task. I found this way after lots of googling since it's most results point to outdated information. I tried this with rspec-2.7.0 gem. Here I assume that you already wrote the rspec tests, now you just need to know how to run those tests as rake tasks.
Here we go.
- Create a Rakefile
- Copy and paste the code below.
- Use task :default => :spec only if you want to run rspec rask as the default task.
- execute the rake command. (rake/bundle exec rake)