Created
October 25, 2011 13:17
-
-
Save johnbintz/1312690 to your computer and use it in GitHub Desktop.
CoverMe with HtmlAndConsole formatter for RSpec, and no browser window opening
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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