Skip to content

Instantly share code, notes, and snippets.

@agraves
Created October 1, 2012 17:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agraves/3813150 to your computer and use it in GitHub Desktop.
Save agraves/3813150 to your computer and use it in GitHub Desktop.
Regain control over default Rake task from Rspec
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path('../config/application', __FILE__)
require 'rake'
require 'rake/testtask'
Web::Application.load_tasks
Rake::TestTask.new do |t|
t.pattern = 'test/**/*.rb'
t.libs.push 'test'
end
Rake.application.instance_variable_get('@tasks').delete('default')
task :default => [:spec, :test]
@agraves
Copy link
Author

agraves commented Oct 1, 2012

Line 15 is due to this: rspec/rspec-rails#123

@agraves
Copy link
Author

agraves commented Nov 2, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment