Skip to content
This repository has been archived by the owner on Oct 27, 2021. It is now read-only.

Commit

Permalink
Enabling aggregate coverage information
Browse files Browse the repository at this point in the history
  • Loading branch information
spicycode committed Sep 7, 2009
1 parent 2d8dffc commit c2291af
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .gitignore
@@ -1,6 +1,6 @@
pkg
doc
coverage
coverage*
tmtags
story_server/prototype/rspec_stories.html
.DS_Store
Expand Down
25 changes: 20 additions & 5 deletions Rakefile
Expand Up @@ -45,26 +45,41 @@ load 'resources/rake/examples_with_rcov.rake'
load 'resources/rake/failing_examples_with_html.rake'
load 'resources/rake/verify_rcov.rake'

task :cleanup_rcov_files do
rm_rf 'coverage.data'
end


if RUBY_VERSION =~ /^1.8/
task :default => [:verify_rcov, :features]
task :default => [:cleanup_rcov_files, :features, :verify_rcov]
else
task :default => [:spec, :features]
end

namespace :spec do

desc "Run all specs with rcov"
Spec::Rake::SpecTask.new('rcov') do |t|
Spec::Rake::SpecTask.new(:rcov) do |t|
t.spec_files = FileList['spec/**/*_spec.rb']
t.spec_opts = ['--options', 'spec/spec.opts']
t.rcov = true
t.rcov_dir = 'coverage'
t.rcov_opts = ['--exclude', "kernel,load-diff-lcs\.rb,instance_exec\.rb,lib/spec.rb,lib/spec/runner.rb,^spec/*,bin/spec,examples,/gems,/Library/Ruby,\.autotest,#{ENV['GEM_HOME']}"]
t.rcov_opts = ['--exclude', "features,kernel,load-diff-lcs\.rb,instance_exec\.rb,lib/spec.rb,lib/spec/runner.rb,^spec/*,bin/spec,examples,/gems,/Library/Ruby,\.autotest,#{ENV['GEM_HOME']}"]
t.rcov_opts << '--sort coverage --text-report --aggregate coverage.data'
end
end

desc "Run Cucumber features"
task :features do
sh(RUBY_VERSION =~ /^1.8/ ? "cucumber" : "cucumber --profile no_heckle")
if RUBY_VERSION =~ /^1.8/
Cucumber::Rake::Task.new :features do |t|
t.rcov = true
t.rcov_opts = ['--exclude', "features,kernel,load-diff-lcs\.rb,instance_exec\.rb,lib/spec.rb,lib/spec/runner.rb,^spec/*,bin/spec,examples,/gems,/Library/Ruby,\.autotest,#{ENV['GEM_HOME']}"]
t.rcov_opts << '--sort coverage --no-html --text-report --aggregate coverage.data'
end
else
task :features do
sh 'cucumber --profile no_heckle'
end
end

desc "Run failing examples (see failure output)"
Expand Down

0 comments on commit c2291af

Please sign in to comment.