Skip to content

Instantly share code, notes, and snippets.

@tenderlove
Last active August 29, 2015 14:15
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 tenderlove/40b567315b29c1dd3561 to your computer and use it in GitHub Desktop.
Save tenderlove/40b567315b29c1dd3561 to your computer and use it in GitHub Desktop.
require 'coverage'
require 'json'
Coverage.start
require 'minitest'
class Minitest::Runnable
LOG = File.open('run_log.txt', 'w')
Minitest.after_run { LOG.close }
class << self
alias :old_run_one_method :run_one_method
def run_one_method klass, method_name, reporter
before = Coverage.peek_result
old_run_one_method klass, method_name, reporter
after = Coverage.peek_result
LOG.puts JSON.dump [ klass.name, method_name.to_s, before, after ]
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment