Skip to content

Commit

Permalink
Enforce code coverage minimum
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Aug 14, 2015
1 parent 1192e50 commit e2bb21d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 28 deletions.
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ group :doc do
end

group :test do
gem 'coveralls', :require => false, :platforms => [:mri_19, :mri_20, :mri_21, :mri_22]
gem 'coveralls', :require => false
gem 'faker', '>= 1.2'
gem 'rest-client', '~> 1.6.0', :platforms => [:jruby, :ruby_18]
gem 'rspec', '>= 3'
gem 'rubocop', '>= 0.27', :platforms => [:ruby_19, :ruby_20, :ruby_21, :ruby_22]
gem 'simplecov', '>= 0.4', :platforms => :ruby_19
gem 'rubocop', '>= 0.33', :platforms => [:jruby, :ruby_19, :ruby_20, :ruby_21, :ruby_22]
gem 'simplecov', '>= 0.4'
end
21 changes: 4 additions & 17 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,31 +1,18 @@
begin
require 'bundler'
Bundler::GemHelper.install_tasks
rescue LoadError
$stderr.puts 'Bundler not installed. You should install it with: gem install bundler'
end

$LOAD_PATH << File.expand_path('./lib', File.dirname(__FILE__))
require 'bluepill/version'

require 'rspec/core/rake_task'
require 'bundler'
Bundler::GemHelper.install_tasks

require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new

if RUBY_VERSION >= '1.9'
RSpec::Core::RakeTask.new(:cov) do |t|
ENV['ENABLE_SIMPLECOV'] = '1'
t.ruby_opts = '-w'
t.rcov_opts = '-Ilib --exclude "spec/*,gems/*"'
end
end

begin
require 'rubocop/rake_task'
RuboCop::RakeTask.new
rescue LoadError
task :rubocop do
$stderr.puts 'Rubocop is disabled'
$stderr.puts 'RuboCop is disabled'
end
end

Expand Down
17 changes: 9 additions & 8 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
if RUBY_VERSION >= '1.9'
if ENV['ENABLE_SIMPLECOV']
require 'simplecov'
SimpleCov.start
end
begin
require 'coveralls'
Coveralls.wear!
rescue LoadError
require 'simplecov'
require 'coveralls'

SimpleCov.formatters = [SimpleCov::Formatter::HTMLFormatter, Coveralls::SimpleCov::Formatter]

SimpleCov.start do
add_filter '/spec/'
add_filter '/vendor/'
minimum_coverage(41.06)
end
end

Expand Down

0 comments on commit e2bb21d

Please sign in to comment.