Skip to content

Commit

Permalink
fix rcov task to not break production rake
Browse files Browse the repository at this point in the history
  • Loading branch information
jlapier committed Jun 14, 2011
1 parent 0e5e363 commit fb6f3a7
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions lib/tasks/rcov.rake
Expand Up @@ -2,24 +2,28 @@ task :cleanup_rcov_files do
rm_rf 'coverage.data'
end

namespace :spec do
task(:rcov).clear_prerequisites.clear_actions
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,spec/*"]
t.rcov_opts << %[ --sort coverage --aggregate coverage.data --rails]
if defined?(RSpec)

namespace :spec do
task(:rcov).clear_prerequisites.clear_actions
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,spec/*"]
t.rcov_opts << %[ --sort coverage --aggregate coverage.data --rails]
end
end
end

namespace :cucumber do
task(:rcov).clear_prerequisites.clear_actions
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,spec/*"]
t.rcov_opts << %[ --sort coverage --aggregate coverage.data --rails]
t.rcov_opts << %[ --output #{Rails.root}/cuc_coverage]
namespace :cucumber do
task(:rcov).clear_prerequisites.clear_actions
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,spec/*"]
t.rcov_opts << %[ --sort coverage --aggregate coverage.data --rails]
t.rcov_opts << %[ --output #{Rails.root}/cuc_coverage]
end
end

end

0 comments on commit fb6f3a7

Please sign in to comment.