Skip to content

Commit

Permalink
update rake tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
dchelimsky committed Oct 10, 2010
1 parent 0238b34 commit a696235
Showing 1 changed file with 30 additions and 10 deletions.
40 changes: 30 additions & 10 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@ require 'rspec/core/rake_task'
require 'rspec/mocks/version'
require 'cucumber/rake/task'

RSpec::Core::RakeTask.new(:spec)

RSpec::Core::RakeTask.new(:rcov) do |spec|
spec.rcov = true
spec.rcov_opts = %[--exclude "core,expectations,gems/*,spec/resources,spec/spec,spec/spec_helper.rb,db/*,/Library/Ruby/*,config/*" --text-summary --sort coverage]
end

class Cucumber::Rake::Task::ForkedCucumberRunner
# When cucumber shells out, we still need it to run in the context of our
# bundle.
Expand All @@ -22,10 +15,38 @@ class Cucumber::Rake::Task::ForkedCucumberRunner
end
end

Cucumber::Rake::Task.new do |t|
t.cucumber_opts = %w{--format progress}
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

task :default => [:spec, :cucumber]

task :clobber do
rm_rf 'pkg'
rm_rf 'tmp'
Expand All @@ -46,5 +67,4 @@ task :relish, :version do |t, args|
sh "bundle exec relish --organization rspec --project rspec-mocks -v #{args[:version]} push"
end


task :default => [:spec, :cucumber]

0 comments on commit a696235

Please sign in to comment.