Permalink
Browse files

Making sure rcov is covered by Gemfile, and adding rcov:all which use…

…s all specs and features to check coverage.
  • Loading branch information...
pat committed Nov 13, 2010
1 parent e7e1e50 commit 5f6e366860a26dcf121e12784b7aca284c6f1722
Showing with 27 additions and 15 deletions.
  1. +1 −0 .gitignore
  2. +1 −0 Gemfile
  3. +25 −15 tasks/testing.rb
View
@@ -3,6 +3,7 @@ Gemfile.lock
gem_deploy.rake
pkg
coverage
+coverage.data
*.tmproj
rdoc
database.yml
View
@@ -13,6 +13,7 @@ group :development do
gem 'rspec-core', '2.0.1'
gem 'rspec-expectations', '2.0.1'
gem 'rspec-mocks', '2.0.1'
+ gem 'rcov', '0.9.8'
gem 'cucumber', '0.9.4'
gem 'will_paginate', '2.3.15'
gem 'ginger', '1.2.0'
View
@@ -32,35 +32,45 @@ def add_task(name, description)
task :postgresql => :check_dependencies
end
-desc "Generate RCov reports"
-RSpec::Core::RakeTask.new(:rcov) do |t|
- t.pattern = 'spec/**/*_spec.rb'
- t.rcov = true
- t.rcov_opts = [
- '--exclude', 'spec',
- '--exclude', 'gems',
- '--exclude', 'riddle',
- '--exclude', 'ruby'
- ]
-end
-
namespace :rcov do
+ desc "Generate RCov reports"
+ RSpec::Core::RakeTask.new(:rspec) do |t|
+ t.pattern = 'spec/**/*_spec.rb'
+ t.rcov = true
+ t.rcov_opts = [
+ '--exclude', 'spec',
+ '--exclude', 'gems',
+ '--exclude', 'riddle',
+ '--exclude', 'ruby',
+ '--aggregate coverage.data'
+ ]
+ end
+
def add_task(name, description)
Cucumber::Rake::Task.new(name, description) do |t|
- t.cucumber_opts = "--format pretty"
- t.profile = name
+ t.cucumber_opts = "--format pretty features/*.feature DATABASE=#{name}"
t.rcov = true
t.rcov_opts = [
'--exclude', 'spec',
'--exclude', 'gems',
'--exclude', 'riddle',
- '--exclude', 'features'
+ '--exclude', 'features',
+ '--aggregate coverage.data'
]
end
end
add_task :mysql, "Run feature-set against MySQL with rcov"
add_task :postgresql, "Run feature-set against PostgreSQL with rcov"
+
+ task :all do
+ rm 'coverage.data' if File.exist?('coverage.data')
+ rm 'rerun.txt' if File.exist?('rerun.txt')
+
+ Rake::Task['rcov:rspec'].invoke
+ Rake::Task['rcov:mysql'].invoke
+ Rake::Task['rcov:postgresql'].invoke
+ end
end
desc "Build cucumber.yml file"

0 comments on commit 5f6e366

Please sign in to comment.