Skip to content

Commit

Permalink
add coveralls
Browse files Browse the repository at this point in the history
  • Loading branch information
gewo committed Aug 26, 2013
1 parent 4a53fed commit 025023f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
1 change: 1 addition & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
service_name: travis-ci
1 change: 1 addition & 0 deletions prevent_blankification_validator.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ Gem::Specification.new do |s|
s.add_development_dependency 'rake'
s.add_development_dependency 'rspec'
s.add_development_dependency 'simplecov'
s.add_development_dependency 'coveralls'
end
25 changes: 15 additions & 10 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
if RUBY_VERSION =~ /1\.9/ && RUBY_ENGINE == 'ruby'
require 'simplecov'
require 'simplecov'
require 'coveralls'

SimpleCov.start do
add_filter "/spec"
end
SimpleCov.start do
add_filter "/spec"
end

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
SimpleCov::Formatter::HTMLFormatter,
Coveralls::SimpleCov::Formatter
]

SimpleCov.at_exit do
File.open(File.join(SimpleCov.coverage_path, 'percent.txt'), 'w') do |f|
f.write SimpleCov.result.covered_percent
end
SimpleCov.result.format!
SimpleCov.at_exit do
File.open(File.join(SimpleCov.coverage_path, 'percent.txt'), 'w') do |f|
f.write SimpleCov.result.covered_percent
end
SimpleCov.result.format!
end
SimpleCov.start

require 'active_model'
require 'prevent_blankification_validator'
Expand Down

0 comments on commit 025023f

Please sign in to comment.