Skip to content

Instantly share code, notes, and snippets.

@ywen
Created February 24, 2012 19:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ywen/1903057 to your computer and use it in GitHub Desktop.
Save ywen/1903057 to your computer and use it in GitHub Desktop.
if ENV["SIMPLECOV"]
p "use simple cov"
require 'simplecov'
SimpleCov.start 'rails'
SimpleCov.at_exit do
threshold = 100
SimpleCov.result.format!
if SimpleCov.result.covered_percent != threshold
puts "the threshold is #{threshold}%. the actual coverage is #{SimpleCov.result.covered_percent}%".foreground(:red)
exit 1
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment