Skip to content

Instantly share code, notes, and snippets.

@krasio
Created April 26, 2012 13:51
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 krasio/2499754 to your computer and use it in GitHub Desktop.
Save krasio/2499754 to your computer and use it in GitHub Desktop.
lib/tasks/rspec.rake
require 'rake'
require 'rspec/core/rake_task'
task :noop do; end
spec_prereq = Rails.configuration.generators.options[:rails][:orm] == :active_record ? "db:test:prepare" : :noop
namespace :spec do
RSpec::Core::RakeTask.new(:lite) do |t|
t.pattern = "spec/{models,presenters}/**/*_spec.rb"
end
RSpec::Core::RakeTask.new(:with_rails) do |t|
t.pattern = "spec/{controllers,integration}/**/*_spec.rb"
end
end
task(:spec).clear.enhance([spec_prereq, "spec:lite", "spec:with_rails"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment