Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

…s all specs and features to check coverage.
  • Loading branch information...
commit 5f6e366860a26dcf121e12784b7aca284c6f1722 1 parent e7e1e50
Pat Allan pat authored

Showing 3 changed files with 27 additions and 15 deletions. Show diff stats Hide diff stats

  1. +1 0  .gitignore
  2. +1 0  Gemfile
  3. +25 15 tasks/testing.rb
1  .gitignore
@@ -3,6 +3,7 @@ Gemfile.lock
3 3 gem_deploy.rake
4 4 pkg
5 5 coverage
  6 +coverage.data
6 7 *.tmproj
7 8 rdoc
8 9 database.yml
1  Gemfile
@@ -13,6 +13,7 @@ group :development do
13 13 gem 'rspec-core', '2.0.1'
14 14 gem 'rspec-expectations', '2.0.1'
15 15 gem 'rspec-mocks', '2.0.1'
  16 + gem 'rcov', '0.9.8'
16 17 gem 'cucumber', '0.9.4'
17 18 gem 'will_paginate', '2.3.15'
18 19 gem 'ginger', '1.2.0'
40 tasks/testing.rb
@@ -32,35 +32,45 @@ def add_task(name, description)
32 32 task :postgresql => :check_dependencies
33 33 end
34 34
35   -desc "Generate RCov reports"
36   -RSpec::Core::RakeTask.new(:rcov) do |t|
37   - t.pattern = 'spec/**/*_spec.rb'
38   - t.rcov = true
39   - t.rcov_opts = [
40   - '--exclude', 'spec',
41   - '--exclude', 'gems',
42   - '--exclude', 'riddle',
43   - '--exclude', 'ruby'
44   - ]
45   -end
46   -
47 35 namespace :rcov do
  36 + desc "Generate RCov reports"
  37 + RSpec::Core::RakeTask.new(:rspec) do |t|
  38 + t.pattern = 'spec/**/*_spec.rb'
  39 + t.rcov = true
  40 + t.rcov_opts = [
  41 + '--exclude', 'spec',
  42 + '--exclude', 'gems',
  43 + '--exclude', 'riddle',
  44 + '--exclude', 'ruby',
  45 + '--aggregate coverage.data'
  46 + ]
  47 + end
  48 +
48 49 def add_task(name, description)
49 50 Cucumber::Rake::Task.new(name, description) do |t|
50   - t.cucumber_opts = "--format pretty"
51   - t.profile = name
  51 + t.cucumber_opts = "--format pretty features/*.feature DATABASE=#{name}"
52 52 t.rcov = true
53 53 t.rcov_opts = [
54 54 '--exclude', 'spec',
55 55 '--exclude', 'gems',
56 56 '--exclude', 'riddle',
57   - '--exclude', 'features'
  57 + '--exclude', 'features',
  58 + '--aggregate coverage.data'
58 59 ]
59 60 end
60 61 end
61 62
62 63 add_task :mysql, "Run feature-set against MySQL with rcov"
63 64 add_task :postgresql, "Run feature-set against PostgreSQL with rcov"
  65 +
  66 + task :all do
  67 + rm 'coverage.data' if File.exist?('coverage.data')
  68 + rm 'rerun.txt' if File.exist?('rerun.txt')
  69 +
  70 + Rake::Task['rcov:rspec'].invoke
  71 + Rake::Task['rcov:mysql'].invoke
  72 + Rake::Task['rcov:postgresql'].invoke
  73 + end
64 74 end
65 75
66 76 desc "Build cucumber.yml file"

0 comments on commit 5f6e366

Please sign in to comment.
Something went wrong with that request. Please try again.