Browse files

Use simplecov instead of rcov

  • Loading branch information...
1 parent d699219 commit f01b3384b3a3fef4b8ee7faeb350df3cfdd5a27e @kaluznyo kaluznyo committed Nov 28, 2012
Showing with 11 additions and 7 deletions.
  1. +6 −7 Rakefile
  2. +1 −0 discogs.gemspec
  3. +4 −0 spec/spec_helper.rb
View
13 Rakefile
@@ -3,20 +3,19 @@ require 'rspec'
require 'rspec/core/rake_task'
require 'rubygems/package_task'
-task :default => :spec
+
desc "Run all specs in spec directory"
RSpec::Core::RakeTask.new(:spec) do |t|
t.rspec_opts = ["--colour"]
t.pattern = 'spec/**/*_spec.rb'
end
-desc "Run all specs and generate RCov report"
-RSpec::Core::RakeTask.new('cov') do |t|
- t.pattern = 'spec/**/*.rb'
- t.rspec_opts = ["--colour"]
- t.rcov = true
- t.rcov_opts = ['-T --no-html --exclude', 'spec\/,gems\/']
+desc "Run all specs and generate simplecov report"
+task :cov do |t|
+ ENV['COVERAGE'] = 'true'
+ Rake::Task["spec"].execute
+ `open coverage/index.html`
end
spec = eval(File.read("discogs.gemspec"))
View
1 discogs.gemspec
@@ -17,5 +17,6 @@ Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.add_development_dependency "rspec", "= 2.12.0"
+ s.add_development_dependency "simplecov", "= 0.7.1"
end
View
4 spec/spec_helper.rb
@@ -1,3 +1,7 @@
+if ENV["COVERAGE"]
+ require 'simplecov'
+ SimpleCov.start
+end
require 'rubygems'
require 'rspec'
require File.dirname(__FILE__) + '/../lib/discogs'

0 comments on commit f01b338

Please sign in to comment.