Skip to content

Commit

Permalink
Add coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Noack committed May 17, 2014
1 parent 9b216a1 commit 97670ac
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions gemfiles/rails2.gemfile
Expand Up @@ -3,4 +3,5 @@ gemspec :path => "../"

group :development, :test do
gem 'rails', '~> 2.0'
gem 'mime-types', '< 2.0', :platforms => :ruby_18
end
1 change: 1 addition & 0 deletions spawnling.gemspec
Expand Up @@ -26,5 +26,6 @@ threads (see lib/patches.rb).}
s.add_development_dependency 'bundler'
s.add_development_dependency 'rake'
s.add_development_dependency 'rspec'
s.add_development_dependency 'coveralls'
s.add_development_dependency 'rails'
end
23 changes: 23 additions & 0 deletions spec/spec_helper.rb
Expand Up @@ -4,6 +4,29 @@

$:.unshift(File.join(File.dirname(__FILE__), %w[.. lib]))

MINIMUM_COVERAGE = 28

if ENV['COVERAGE']
require 'simplecov'
require 'coveralls'
Coveralls.wear!

SimpleCov.formatter = Coveralls::SimpleCov::Formatter
SimpleCov.start do
add_filter '/vendor/'
add_filter '/spec/'
add_group 'lib', 'lib'
end
SimpleCov.at_exit do
SimpleCov.result.format!
percent = SimpleCov.result.covered_percent
unless percent >= MINIMUM_COVERAGE
puts "Coverage must be above #{MINIMUM_COVERAGE}%. It is #{"%.2f" % percent}%"
Kernel.exit(1)
end
end
end

require 'spawnling'
Spec::Runner.configure do |config|

Expand Down

0 comments on commit 97670ac

Please sign in to comment.