Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

one default,please

  • Loading branch information...
commit fdc4160b364d7c554ce11c48d62c4c4b49b155d6 1 parent 3b69fd6
@dchelimsky dchelimsky authored
Showing with 30 additions and 2 deletions.
  1. +30 −2 Rakefile
View
32 Rakefile
@@ -20,7 +20,6 @@ require 'rspec'
require 'rspec/core/rake_task'
require 'cucumber/rake/task'
-RSpec::Core::RakeTask.new(:spec)
class Cucumber::Rake::Task::ForkedCucumberRunner
# When cucumber shells out, we still need it to run in the context of our
# bundle.
@@ -28,8 +27,37 @@ class Cucumber::Rake::Task::ForkedCucumberRunner
sh "bundle exec #{RUBY} " + args.join(" ")
end
end
+
+task :cleanup_rcov_files do
+ rm_rf 'coverage.data'
+end
+
+desc "Run all examples"
+RSpec::Core::RakeTask.new(:spec) do |t|
+ t.rspec_opts = %w[--color]
+end
+
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
+
+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}
+ t.rcov = true
+ t.rcov_opts = %[-Ilib -Ispec --exclude "gems/*,features"]
+ t.rcov_opts << %[--text-report --sort coverage --aggregate coverage.data]
+ end
+end
+
namespace :generate do
desc "generate a fresh app with rspec installed"
task :app do |t|
@@ -91,5 +119,5 @@ task :relish, :version do |t, args|
sh "bundle exec relish --organization rspec --project rspec-rails -v #{args[:version]} push"
end
-task :default => [:spec, "clobber:app", "generate:app", "generate:stuff", :cucumber, :smoke]
+task :default => [:spec, "clobber:app", "generate:app", "generate:stuff", :smoke, :cucumber]
Please sign in to comment.
Something went wrong with that request. Please try again.