Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

partition specs into multiple suites #36

Merged
merged 1 commit into from

2 participants

@senny

I created 3 spec suites:

  • unit => rake spec:unit
  • integration => rake spec:integration
  • examples => rake spec:examples

calling 'rake' without arguments runs them all in sequence

@solnic solnic merged commit e8b817b into solnic:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
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'
Something went wrong with that request. Please try again.