assumption of default task blows up rake #377

jackdempsey opened this Issue May 21, 2011 · 2 comments


None yet

2 participants


In a new rails 3.1.beta app, rspec-rails 2.6 is trying to delete the default task 'test'. Only problem is that it's not found, so we call prerequisites on nil, and boom goes the dynamite.

Here's the small fix:

+if default = Rake.application.instance_variable_get('@tasks')['default']

  • default.prerequisites.delete('test') +end

Things run smoothly after that.

Gemfile for reference:

source :rubygems

#gem 'rails', '~> 3.0.6'
gem 'rails', :git => 'git://'
gem 'arel', :git => 'git://'
gem "rack", :git => "git://"

#gem "sprockets", :git => "git://"
gem "sprockets", "2.0.0.beta.5"
gem 'rake', '0.8.7'

gem 'sqlite3'

gem 'json'
gem 'sass'
gem 'coffee-script'
gem 'uglifier'

gem 'jquery-rails'

group :development, :test do
gem 'rspec-rails'
gem 'capybara', :git => 'git://'
gem 'launchy'
gem 'database_cleaner'

If you'd like a proper pull request, happy to put one together, just wanted to get this out there given the simple nature.

RSpec member

Pull request is better because I want your name in the commit log :)

RSpec member

Moved to #378

@dchelimsky dchelimsky closed this May 21, 2011
@kaiwren kaiwren pushed a commit to c42engineering/rspec-rails that referenced this issue May 24, 2011
@jackdempsey jackdempsey guard against calling prerequisites on nil
- Closes #377.
- Closes #378.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment