Skip to content
This repository
Browse code

Use simplecov instead of rcov

  • Loading branch information...
commit f01b3384b3a3fef4b8ee7faeb350df3cfdd5a27e 1 parent d699219
Olivier Kaluzny kaluznyo authored

Showing 3 changed files with 11 additions and 7 deletions. Show diff stats Hide diff stats

  1. +6 7 Rakefile
  2. +1 0  discogs.gemspec
  3. +4 0 spec/spec_helper.rb
13 Rakefile
@@ -3,7 +3,7 @@ require 'rspec'
3 3 require 'rspec/core/rake_task'
4 4 require 'rubygems/package_task'
5 5
6   -task :default => :spec
  6 +
7 7
8 8 desc "Run all specs in spec directory"
9 9 RSpec::Core::RakeTask.new(:spec) do |t|
@@ -11,12 +11,11 @@ RSpec::Core::RakeTask.new(:spec) do |t|
11 11 t.pattern = 'spec/**/*_spec.rb'
12 12 end
13 13
14   -desc "Run all specs and generate RCov report"
15   -RSpec::Core::RakeTask.new('cov') do |t|
16   - t.pattern = 'spec/**/*.rb'
17   - t.rspec_opts = ["--colour"]
18   - t.rcov = true
19   - t.rcov_opts = ['-T --no-html --exclude', 'spec\/,gems\/']
  14 +desc "Run all specs and generate simplecov report"
  15 +task :cov do |t|
  16 + ENV['COVERAGE'] = 'true'
  17 + Rake::Task["spec"].execute
  18 + `open coverage/index.html`
20 19 end
21 20
22 21 spec = eval(File.read("discogs.gemspec"))
1  discogs.gemspec
@@ -17,5 +17,6 @@ Gem::Specification.new do |s|
17 17 s.platform = Gem::Platform::RUBY
18 18
19 19 s.add_development_dependency "rspec", "= 2.12.0"
  20 + s.add_development_dependency "simplecov", "= 0.7.1"
20 21
21 22 end
4 spec/spec_helper.rb
... ... @@ -1,3 +1,7 @@
  1 +if ENV["COVERAGE"]
  2 + require 'simplecov'
  3 + SimpleCov.start
  4 +end
1 5 require 'rubygems'
2 6 require 'rspec'
3 7 require File.dirname(__FILE__) + '/../lib/discogs'

0 comments on commit f01b338

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