Skip to content

Instantly share code, notes, and snippets.

@expectedbehavior
Created February 2, 2010 18:30
Show Gist options
  • Save expectedbehavior/292888 to your computer and use it in GitHub Desktop.
Save expectedbehavior/292888 to your computer and use it in GitHub Desktop.
A console testrunner hack to show big dots for long-running tests
require 'test/unit/ui/console/testrunner'
require File.join("#{RAILS_ROOT}/lib", 'patches/testrunner')
# -*- coding: utf-8 -*-
module Test
module Unit
module UI
module Console
class TestRunner
def test_started(name)
@individual_test_start_time = Time.now
output_single(name + ": ", VERBOSE)
end
def test_finished(name)
elapsed_test_time = Time.now - @individual_test_start_time
char_to_output = elapsed_test_time > 1 ? "☻" : "."
output_single(char_to_output, PROGRESS_ONLY) unless (@already_outputted)
nl(VERBOSE)
@already_outputted = false
end
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment