_prepare_run(suites, type)public
No documentation available.
# File lib/test/unit.rb, line 682
def _prepare_run(suites, type)
options[:job_status] ||= :replace if @tty && !@verbose
case options[:color]
when :always
color = true
when :auto, nil
color = @options[:job_status] == :replace && /dumb/ !~ ENV["TERM"]
else
color = false
end
if color
# dircolors-like style
colors = (colors = ENV['TEST_COLORS']) ? Hash[colors.scan(/(\w+)=([^:]*)/)] : {}
@passed_color = "\e[#{colors["pass"] || "32"}m"
@failed_color = "\e[#{colors["fail"] || "31"}m"
@skipped_color = "\e[#{colors["skip"] || "33"}m"
@reset_color = "\e[m"
else
@passed_color = @failed_color = @skipped_color = @reset_color = ""
end
if color or @options[:job_status] == :replace
@verbose = !options[:parallel]
@output = StatusLineOutput.new(self)
end
if /\A\/(.*)\/\z/ =~ (filter = options[:filter])
filter = Regexp.new($1)
end
type = "#{type}_methods"
total = if filter
suites.inject(0) {|n, suite| n + suite.send(type).grep(filter).size}
else
suites.inject(0) {|n, suite| n + suite.send(type).size}
end
@test_count = 0
@total_tests = total.to_s(10)
end