Skip to content


Subversion checkout URL

You can clone with
Download ZIP


guard against calling prerequisites on nil #378

wants to merge 1 commit into from

3 participants


Just generated a new test app with rails edge and rspec-rails 2.6 to debug some other stuff, and saw rake blowing up on me. Can't be 100% certain default task is now gone, but this small patch makes sure we don't try to call something on nil and blow everything up.

Tried to run rake to make sure all tests still pass, and ran into some issues:

git/rspec-rails handle_nil_default_task > thor gemfile:use 3.0.7
Using gemfiles/rails-3.0.7
bundle install --binstubs
Fetching source index for
Could not find gem 'rspec-expectations (~> 2.4.0)', required by 'rspec', in any of the sources

so just sending over anyway given the tiny change.

@dchelimsky dchelimsky closed this

Nice, this is fix my problems

@kaiwren kaiwren referenced this pull request from a commit in c42engineering/rspec-rails
@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
Commits on May 21, 2011
  1. @jackdempsey
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/rspec/rails/tasks/rspec.rake
4 lib/rspec/rails/tasks/rspec.rake
@@ -1,6 +1,8 @@
require 'rspec/core'
require 'rspec/core/rake_task'
+if default = Rake.application.instance_variable_get('@tasks')['default']
+ default.prerequisites.delete('test')
spec_prereq = Rails.configuration.generators.options[:rails][:orm] == :active_record ? "db:test:prepare" : :noop
task :noop do; end
Something went wrong with that request. Please try again.