Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ssetting up rspec2 task in Rakefile

I have a Rakefile that looks like this:

require 'rspec/core/rake_task'

desc "Run all RSpec tests"
RSpec::Core::RakeTask.new(:spec)

This isn't working though. For example, if I try to run "rake -T", I get:

code/projects/bellybuster[master]% rake -T --trace
(in /Users/craig/code/projects/bellybuster)
rake aborted!
no such file to load -- rspec/core/rake_task
/Users/craig/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/Users/craig/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/Users/craig/code/projects/bellybuster/Rakefile:1:in `<top (required)>'
/Users/craig/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2383:in `load'

Any thoughts?

In case it might be helpful here's the Gemfile:

source :rubygems

gemspec

Oh and some versions:

  • Ruby: 1.9.2p180
  • Rake: 0.8.7
  • Bundler: 1.0.13
  • RubyGems: 1.7.2
like image 231
codecraig Avatar asked May 21 '11 03:05

codecraig


1 Answers

The syntax looks fine to me. Are you 100% sure you have rspec 2 installed? Does it appear with gem which rspec? Maybe you forgot to run bundle install or you don't list rspec in the .gemspec file as a (development) dependency?

like image 185
Carl Suster Avatar answered Oct 01 '22 02:10

Carl Suster