Skip to content

Instantly share code, notes, and snippets.

@knorrium
Forked from fhwang/gist:1887192
Created February 5, 2013 17:10
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 knorrium/4715908 to your computer and use it in GitHub Desktop.
Save knorrium/4715908 to your computer and use it in GitHub Desktop.
namespace :spec do
namespace :units do
desc "Run unit specs with PATTERN in the spec file name"
RSpec::Core::RakeTask.new(:selective => "db:test:prepare") do |t|
t.pattern = FileList["spec/**/*#{ENV['PATTERN']}*_spec.rb"].exclude("spec/integration/**/*_spec.rb")
end
end
namespace :integration do
desc "Run integration specs with PATTERN in the spec file name"
RSpec::Core::RakeTask.new(:selective => "db:test:prepare") do |t|
t.pattern = FileList["spec/integration/**/*#{ENV['PATTERN']}*_spec.rb"]
end
end
desc "Run all specs with PATTERN in the spec file name"
task :selective => ["spec:units:selective", "spec:integration:selective"]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment