Permalink
Browse files

update rake tasks

  • Loading branch information...
1 parent 7ee05db commit 4039e7329aa10f9f653227d37a68fc232aaf5cb7 @dchelimsky dchelimsky committed Oct 10, 2010
Showing with 29 additions and 31 deletions.
  1. +29 −31 Rakefile
View
60 Rakefile
@@ -10,53 +10,51 @@ require "rspec/core/rake_task"
require "rspec/core/version"
require "cucumber/rake/task"
-desc "Run all examples"
-RSpec::Core::RakeTask.new(:spec) do |t|
- t.rspec_path = 'bin/rspec'
- t.rspec_opts = %w[--color]
-end
-
-desc "Run all examples using rcov"
-RSpec::Core::RakeTask.new :rcov => :cleanup_rcov_files do |t|
- t.rcov = true
- t.rspec_opts = %w[--color]
- t.rcov_opts = %[-Ilib -Ispec --exclude "mocks,expectations,gems/*,spec/resources,spec/lib,spec/spec_helper.rb,db/*,/Library/Ruby/*,config/*"]
- t.rcov_opts << %[--no-html --aggregate coverage.data]
+class Cucumber::Rake::Task::ForkedCucumberRunner
+ # When cucumber shells out, we still need it to run in the context of our
+ # bundle.
+ def run
+ sh "bundle exec #{RUBY} " + args.join(" ")
+ end
end
task :cleanup_rcov_files do
rm_rf 'coverage.data'
end
-task :clobber do
- rm_rf 'pkg'
- rm_rf 'tmp'
- rm_rf 'coverage'
+desc "Run all examples"
+RSpec::Core::RakeTask.new(:spec) do |t|
+ t.rspec_path = 'bin/rspec'
+ t.rspec_opts = %w[--color]
end
-class Cucumber::Rake::Task::ForkedCucumberRunner
- # When cucumber shells out, we still need it to run in the context of our
- # bundle.
- def run
- sh "bundle exec #{RUBY} " + args.join(" ")
+Cucumber::Rake::Task.new(:cucumber)
+
+namespace :spec do
+ desc "Run all examples using rcov"
+ RSpec::Core::RakeTask.new :rcov => :cleanup_rcov_files do |t|
+ t.rcov = true
+ t.rcov_opts = %[-Ilib -Ispec --exclude "gems/*,features"]
+ t.rcov_opts << %[--text-report --sort coverage --no-html --aggregate coverage.data]
end
end
-if RUBY_VERSION.to_f >= 1.9
- Cucumber::Rake::Task.new(:cucumber) do |t|
+namespace :cucumber do
+ desc "Run cucumber features using rcov"
+ Cucumber::Rake::Task.new :rcov => :cleanup_rcov_files do |t|
t.cucumber_opts = %w{--format progress}
- end
-
- task :default => [:spec, :cucumber]
-else
- Cucumber::Rake::Task.new(:cucumber) do |t|
t.rcov = true
- t.rcov_opts = %[-Ilib -Ispec --exclude "mocks,expectations,gems/*,features,spec/ruby_forker,spec/rspec,spec/resources,spec/lib,spec/spec_helper.rb,db/*,/Library/Ruby/*,config/*"]
+ t.rcov_opts = %[-Ilib -Ispec --exclude "gems/*,features"]
t.rcov_opts << %[--text-report --sort coverage --aggregate coverage.data]
- t.cucumber_opts = %w{--format progress}
end
+end
+
+task :default => [:spec, :cucumber]
- task :default => [:rcov, :cucumber]
+task :clobber do
+ rm_rf 'pkg'
+ rm_rf 'tmp'
+ rm_rf 'coverage'
end
desc "Push cukes to relishapp using the relish-client-gem"

0 comments on commit 4039e73

Please sign in to comment.