Permalink
Browse files

partition specs into multiple suites: rake to run everything

  • Loading branch information...
1 parent 64c7eae commit 566692a6cf3a30f470a2821785b8ed8280c7a175 @senny senny committed Nov 15, 2011
Showing with 18 additions and 5 deletions.
  1. +1 −2 Rakefile
  2. +17 −3 tasks/spec.rake
View
3 Rakefile
@@ -1,8 +1,7 @@
require 'rubygems'
require 'rake'
-require 'rspec/core/rake_task'
FileList['tasks/**/*.rake'].each { |task| import task }
-desc 'Default: run specs.'
+desc 'Default: run all specs'
task :default => :spec
View
20 tasks/spec.rake
@@ -1,7 +1,22 @@
begin
require 'rspec/core/rake_task'
- RSpec::Core::RakeTask.new(:spec)
+ desc 'run all specs'
+ task :spec => ['spec:unit', 'spec:integration', 'spec:examples']
+
+ namespace :spec do
+ RSpec::Core::RakeTask.new(:examples) do |t|
+ t.pattern = 'examples/**/*_spec.rb'
+ end
+
+ RSpec::Core::RakeTask.new(:integration) do |t|
+ t.pattern = 'spec/integration/**/*_spec.rb'
+ end
+
+ RSpec::Core::RakeTask.new(:unit) do |t|
+ t.pattern = 'spec/unit/**/*_spec.rb'
+ end
+ end
rescue LoadError
task :spec do
abort 'rspec is not available. In order to run spec, you must: gem install rspec'
@@ -22,5 +37,4 @@ rescue LoadError
end
end
-task :test => :spec
-task :default => :spec
+task :test => 'spec'

0 comments on commit 566692a

Please sign in to comment.