From 8643925b8a85193b2418fee5e33d8c14c3ac82bf Mon Sep 17 00:00:00 2001 From: Philipp Tessenow Date: Tue, 28 May 2013 17:35:54 +0200 Subject: [PATCH] lets push coverage data to coveralls when all tests pass --- .travis.yml | 2 ++ features/support/env.rb | 11 +++++++---- spec/spec_helper.rb | 4 ++++ test/test_helper.rb | 2 +- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 109d9dbe18..2504402d30 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,8 @@ before_install: - "sh -e /etc/init.d/xvfb start" before_script: - "RAILS_ENV=production bundle exec rake ci:travis:prepare" +after_success: + - "RAILS_ENV=production bundle exec rake coveralls:push" branches: only: - feature/rails3 diff --git a/features/support/env.rb b/features/support/env.rb index 7259a8517f..05b2c0107b 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -1,11 +1,14 @@ # IMPORTANT: This file is generated by cucumber-rails - edit at your own peril. -# It is recommended to regenerate this file in the future when you upgrade to a -# newer version of cucumber-rails. Consider adding your own code to a new file +# It is recommended to regenerate this file in the future when you upgrade to a +# newer version of cucumber-rails. Consider adding your own code to a new file # instead of editing this one. Cucumber will automatically load all features/**/*.rb # files. require 'cucumber/rails' +require 'coveralls' +Coveralls.wear_merged!('rails') + # Load paths to ensure they are loaded before the plugin's paths.rbs. # Plugin's path_to functions rely on being loaded after the core's path_to # function, since they call super if they don't match and the core doesn't. @@ -27,8 +30,8 @@ Capybara.configure do |config| end # By default, any exception happening in your Rails application will bubble up -# to Cucumber so that your scenario will fail. This is a different from how -# your application behaves in the production environment, where an error page will +# to Cucumber so that your scenario will fail. This is a different from how +# your application behaves in the production environment, where an error page will # be rendered instead. # # Sometimes we want to override this default behaviour and allow Rails to rescue diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 6fe9a67f1f..57d4fe6627 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -2,6 +2,10 @@ require 'rubygems' # This file is copied to spec/ when you run 'rails generate rspec:install' ENV["RAILS_ENV"] ||= 'test' + +require 'coveralls' +Coveralls.wear_merged!('rails') + require File.expand_path("../../config/environment", __FILE__) require 'rspec/rails' diff --git a/test/test_helper.rb b/test/test_helper.rb index 8fd9f88607..f90a34d50f 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -15,7 +15,7 @@ ENV["RAILS_ENV"] = "test" require 'coveralls' -Coveralls.wear!('rails') +Coveralls.wear_merged!('rails') require File.expand_path('../../config/environment', __FILE__) require 'rails/test_help'