Skip to content

Instantly share code, notes, and snippets.

@tenderlove
Created July 16, 2013 02:12
Show Gist options
  • Save tenderlove/6005248 to your computer and use it in GitHub Desktop.
Save tenderlove/6005248 to your computer and use it in GitHub Desktop.
require 'minitest'
module Minitest
def self.plugin_common_init options
reporter << CommonTests.new
end
end
class CommonTests < Minitest::AbstractReporter
def initialize
@results = []
end
def record result
@results << result unless result.passed? || result.skipped?
end
def report
results = @results.group_by { |result|
result.failures.map { |e| e.backtrace }
}
print "#" * 20
print " COMMON STACK "
puts "#" * 20
x = results.map do |stack,rs|
rs.each do |result|
"\n%3d) %s" % [1, result] # fixme
end
end.join("\n") + "\n"
puts x
end
end
Minitest.extensions << 'common'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment