From 403d6abd05d71c38686b14917043edf29635b701 Mon Sep 17 00:00:00 2001 From: Thomas Reynolds Date: Thu, 30 May 2013 13:38:52 -0400 Subject: [PATCH] fix up simplecov, add coveralls --- Gemfile | 1 + README.md | 2 ++ middleman-core/.simplecov | 6 ++++++ middleman-core/features/support/env.rb | 15 +++++---------- middleman-core/spec/spec_helper.rb | 4 ++++ 5 files changed, 18 insertions(+), 10 deletions(-) create mode 100644 middleman-core/.simplecov diff --git a/Gemfile b/Gemfile index 31989c07..373ec22d 100644 --- a/Gemfile +++ b/Gemfile @@ -30,6 +30,7 @@ end # Code Quality gem "cane", :platforms => [:mri_19, :mri_20], :require => false +gem 'coveralls', :require => false # Middleman itself gem "middleman-core", :path => "middleman-core" diff --git a/README.md b/README.md index 82f5f5d9..3c7011f8 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,7 @@ Additionally, up-to-date generated code documentation is available on [RubyDoc]. [![Gem Version](https://badge.fury.io/rb/middleman.png)][gem] [![Build Status](https://travis-ci.org/middleman/middleman.png)][travis] +[![Code Coverage](https://coveralls.io/repos/middleman/middleman/badge.png)][coveralls] [![Dependency Status](https://gemnasium.com/middleman/middleman.png?travis)][gemnasium] [![Code Quality](https://codeclimate.com/github/middleman/middleman.png)][codeclimate] @@ -91,6 +92,7 @@ Copyright (c) 2010-2013 Thomas Reynolds. MIT Licensed, see [LICENSE] for details [middleman]: http://middlemanapp.com [gem]: https://rubygems.org/gems/middleman [travis]: http://travis-ci.org/middleman/middleman +[coveralls]: https://coveralls.io/r/middleman/middleman [gemnasium]: https://gemnasium.com/middleman/middleman [codeclimate]: https://codeclimate.com/github/middleman/middleman [rubyinstaller]: http://rubyinstaller.org/ diff --git a/middleman-core/.simplecov b/middleman-core/.simplecov new file mode 100644 index 00000000..ec9447f6 --- /dev/null +++ b/middleman-core/.simplecov @@ -0,0 +1,6 @@ +SimpleCov.start do + add_filter '/features/' + add_filter '/spec/' + add_filter '/vendor' + add_filter '/step_definitions/' +end \ No newline at end of file diff --git a/middleman-core/features/support/env.rb b/middleman-core/features/support/env.rb index c2413793..ba524651 100644 --- a/middleman-core/features/support/env.rb +++ b/middleman-core/features/support/env.rb @@ -1,16 +1,11 @@ ENV["TEST"] = "true" ENV["AUTOLOAD_SPROCKETS"] = "false" -if ENV["COVERAGE"] && (RUBY_VERSION =~ /1\.9/ || RUBY_VERSION =~ /2\.0/) - require 'simplecov' - SimpleCov.root(File.expand_path(File.dirname(__FILE__) + '/../..')) - SimpleCov.start do - add_filter '/features/' - add_filter '/spec/' - add_filter '/vendor' - add_filter '/step_definitions/' - end -end +require 'simplecov' +SimpleCov.root(File.expand_path(File.dirname(__FILE__) + '/../..')) + +require 'coveralls' +Coveralls.wear! PROJECT_ROOT_PATH = File.dirname(File.dirname(File.dirname(__FILE__))) require File.join(PROJECT_ROOT_PATH, 'lib', 'middleman-core') diff --git a/middleman-core/spec/spec_helper.rb b/middleman-core/spec/spec_helper.rb index 6d75bd08..7ef65140 100644 --- a/middleman-core/spec/spec_helper.rb +++ b/middleman-core/spec/spec_helper.rb @@ -1 +1,5 @@ require 'simplecov' +SimpleCov.root(File.expand_path(File.dirname(__FILE__) + '/..')) + +require 'coveralls' +Coveralls.wear! \ No newline at end of file