From 0db9d9a9a426e3415155befcde05ff1ba6013848 Mon Sep 17 00:00:00 2001 From: Rob Nelson Date: Wed, 2 Nov 2016 18:28:48 +0000 Subject: [PATCH] Use coveralls in conjuction with simplecov --- skeleton/Gemfile | 3 +-- skeleton/spec/spec_helper.rb | 14 +++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/skeleton/Gemfile b/skeleton/Gemfile index b699195..89ef422 100644 --- a/skeleton/Gemfile +++ b/skeleton/Gemfile @@ -9,8 +9,7 @@ group :test do gem "metadata-json-lint" gem "rspec-puppet-facts" gem 'rubocop', '0.33.0' - gem 'simplecov', '>= 0.11.0' - gem 'simplecov-console' + gem 'coveralls', :require => false if RUBY_VERSION >= '2.0.0' gem "puppet-lint-absolute_classname-check" gem "puppet-lint-leading_zero-check" diff --git a/skeleton/spec/spec_helper.rb b/skeleton/spec/spec_helper.rb index f2e5985..43256c9 100644 --- a/skeleton/spec/spec_helper.rb +++ b/skeleton/spec/spec_helper.rb @@ -4,15 +4,19 @@ include RspecPuppetFacts require 'simplecov' -require 'simplecov-console' +unless RUBY_VERSION =~ %r{^1.9} + require 'coveralls' + Coveralls.wear! +end + +SimpleCov.formatters = [ + SimpleCov::Formatter::HTMLFormatter, + Coveralls::SimpleCov::Formatter +] SimpleCov.start do add_filter '/spec' add_filter '/vendor' - formatter SimpleCov::Formatter::MultiFormatter.new([ - SimpleCov::Formatter::HTMLFormatter, - SimpleCov::Formatter::Console - ]) end RSpec.configure do |c|