From cd19ca4edacb0586eeae04e22dec60e2b1fa3ae9 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Sat, 20 Apr 2013 17:38:01 -0300 Subject: [PATCH] Improve simplecov result merging --- spec/acceptance_helper.rb | 4 ++++ spec/spec_helper.rb | 10 ++-------- spec/unit_helper.rb | 4 ++++ tasks/spec.rake | 4 ++++ 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/spec/acceptance_helper.rb b/spec/acceptance_helper.rb index a71724e..0f2e04f 100644 --- a/spec/acceptance_helper.rb +++ b/spec/acceptance_helper.rb @@ -1,5 +1,9 @@ require 'spec_helper' +if defined? SimpleCov + SimpleCov.command_name 'acceptance' +end + require 'vagrant' require 'vagrant-lxc' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 07038e7..bdbc54b 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -2,14 +2,8 @@ if ENV['COVERAGE'] require 'simplecov' require 'coveralls' - SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ - SimpleCov::Formatter::HTMLFormatter, - Coveralls::SimpleCov::Formatter - ] - - SimpleCov.start do - add_filter { |source_file| source_file.filename =~ /\/spec\/support/ } - end + SimpleCov.start { add_filter '/spec/' } + SimpleCov.merge_timeout 300 end require 'bundler/setup' diff --git a/spec/unit_helper.rb b/spec/unit_helper.rb index 9104290..d091266 100644 --- a/spec/unit_helper.rb +++ b/spec/unit_helper.rb @@ -1,5 +1,9 @@ require 'spec_helper' +if defined? SimpleCov + SimpleCov.command_name 'unit' +end + RSpec.configure do |config| config.include RSpec::Fire diff --git a/tasks/spec.rake b/tasks/spec.rake index d7e61a6..12a4111 100644 --- a/tasks/spec.rake +++ b/tasks/spec.rake @@ -1,11 +1,15 @@ begin require 'rspec/core/rake_task' + require 'coveralls/rake/task' desc 'Run all specs' task :spec => ['spec:unit', 'spec:acceptance'] desc 'Default task which runs all specs with code coverage enabled' task :default => ['spec:set_coverage', 'spec'] + + Coveralls::RakeTask.new + task :ci => [:default, 'coveralls:push'] rescue LoadError; end namespace :spec do