Skip to content

Instantly share code, notes, and snippets.

@johnbintz
Created October 25, 2011 13:17
Show Gist options
  • Save johnbintz/1312690 to your computer and use it in GitHub Desktop.
Save johnbintz/1312690 to your computer and use it in GitHub Desktop.
CoverMe with HtmlAndConsole formatter for RSpec, and no browser window opening
if ENV['COVERAGE']
require 'cover_me'
class CoverMe::HtmlAndConsoleFormatter < CoverMe::HtmlFormatter
def format_index(index)
super
puts "\n\n[CoverMe] Current coverage: #{index.percent_tested}%"
end
end
CoverMe.config do |c|
c.formatter = CoverMe::HtmlAndConsoleFormatter
c.at_exit = lambda {}
end
RSpec.configure do |config|
config.after(:suite) do
CoverMe.complete!
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment