Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix metrics:coverage task to run under 1.9

  • Loading branch information...
commit 4fd0f0b2a5ba0f46454c18c306936e38072a6dc8 1 parent a1de6ea
@dkubb authored
Showing with 17 additions and 4 deletions.
  1. +1 −1  Gemfile
  2. +11 −0 spec/spec_helper.rb
  3. +5 −3 tasks/spec.rake
View
2  Gemfile
@@ -60,7 +60,7 @@ group :metrics do
gem 'ruby2ruby', '= 1.2.2' # for heckle
end
- platforms :ruby_19 do
+ platforms :mri_19 do
gem 'simplecov', '~> 0.7.1'
end
View
11 spec/spec_helper.rb
@@ -1,5 +1,16 @@
# encoding: utf-8
+if ENV['COVERAGE'] == 'true'
+ require 'simplecov'
+
+ SimpleCov.start do
+ command_name 'spec:unit'
+ add_filter 'config'
+ add_filter 'spec'
+ minimum_coverage 100
+ end
+end
+
require 'veritas'
require 'spec'
require 'spec/autorun'
View
8 tasks/spec.rake
@@ -33,10 +33,13 @@ rescue LoadError
end
namespace :metrics do
+ lib = RUBY_VERSION < '1.9' ? 'rcov' : 'simplecov'
begin
- require 'spec/rake/spectask'
+ require lib
+
+ if lib == 'rcov'
+ require 'spec/rake/spectask'
- if RUBY_VERSION < '1.9'
desc 'Generate code coverage'
Spec::Rake::SpecTask.new(:coverage) do |rcov|
spec_defaults.call(rcov)
@@ -53,7 +56,6 @@ namespace :metrics do
end
rescue LoadError
task :coverage do
- lib = RUBY_VERSION < '1.9' ? 'rcov' : 'simplecov'
$stderr.puts "coverage is not available. In order to run #{lib}, you must: gem install #{lib}"
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.