Skip to content

Commit

Permalink
Splitting SpecReporter#report for enhanced extensibility. closes #205
Browse files Browse the repository at this point in the history
  • Loading branch information
th1agoalmeida committed Apr 19, 2016
1 parent c20e37e commit 2e7976d
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions lib/minitest/reporters/spec_reporter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,8 @@ def report

def record(test)
super
test_name = test.name.gsub(/^test_: /, 'test:')
print pad_test(test_name)
print_colored_status(test)
print(" (%.2fs)" % test.time) unless test.time.nil?
puts
if !test.skipped? && test.failure
print_info(test.failure)
puts
end
record_print_status(test)
record_print_failures_if_any(test)
end

protected
Expand All @@ -48,6 +41,21 @@ def before_suite(suite)
def after_suite(suite)
puts
end

def record_print_status(test)
test_name = test.name.gsub(/^test_: /, 'test:')
print pad_test(test_name)
print_colored_status(test)
print(" (%.2fs)" % test.time) unless test.time.nil?
puts
end

def record_print_failures_if_any(test)
if !test.skipped? && test.failure
print_info(test.failure)
puts
end
end
end
end
end

0 comments on commit 2e7976d

Please sign in to comment.