module Minitest::Reporters::Ws::Formatting
Constants
- INFO_PADDING
Public Instance Methods
err_info(e)
click to toggle source
# File lib/minitest/reporters/ws/formatting.rb, line 64 def err_info(e) err = "" e.message.each_line { |line| err += "<p>#{line}</p>" } trace = filter_backtrace(e.backtrace) trace.each { |line| err += "<p>#{line}</p>" } err end
get_description(runner, test)
click to toggle source
# File lib/minitest/reporters/ws/formatting.rb, line 5 def get_description(runner, test) "#{test.suite}: <b>#{test.test}</b>" end
pad(str, size)
click to toggle source
# File lib/minitest/reporters/ws/formatting.rb, line 74 def pad(str, size) ' ' * size + str end
print_after_suite(suite)
click to toggle source
# File lib/minitest/reporters/ws/formatting.rb, line 47 def print_after_suite(suite) puts "#{@test_count} Tests - #{suite}" %w(P E F S).each do |status| print("#{@emoji[status]} => " + @emoji[status]*@results[status] + " #{@results[status]}") puts; end puts; end
print_after_suites()
click to toggle source
# File lib/minitest/reporters/ws/formatting.rb, line 56 def print_after_suites puts "FINISHED - #{runner.test_count} tests ran" %w(P E F S).each do |status| print("#{@emoji[status]} => " + @emoji[status]*@suites_results[status] + " #{@suites_results[status]}") puts; end end
print_err(suite, test, test_runner)
click to toggle source
# File lib/minitest/reporters/ws/formatting.rb, line 41 def print_err(suite, test, test_runner) puts @emoji['E'] + red { " ERROR #{suite}" } puts red { " #{print_time(test)} #{test}" } puts print_info(test_runner.exception) unless @client.connected? end
print_fail(suite, test, test_runner)
click to toggle source
# File lib/minitest/reporters/ws/formatting.rb, line 35 def print_fail(suite, test, test_runner) puts @emoji['F'] + red { " FAIL #{suite}" } puts red { " #{print_time(test)} #{test}" } puts print_info(test_runner.exception) unless @client.connected? end
print_info(e)
click to toggle source
# File lib/minitest/reporters/ws/formatting.rb, line 14 def print_info(e) e.message.each_line { |line| print_with_info_padding(line) } trace = filter_backtrace(e.backtrace) trace.each { |line| print_with_info_padding(line) } end
print_pass(suite, test, test_runner)
click to toggle source
TODO: fix printing
# File lib/minitest/reporters/ws/formatting.rb, line 23 def print_pass(suite, test, test_runner) unless @client.connected? # do nothing end end
print_skip(suite, test, test_runner)
click to toggle source
# File lib/minitest/reporters/ws/formatting.rb, line 29 def print_skip(suite, test, test_runner) puts @emoji['S'] + yellow { " SKIP #{suite}" } puts yellow { " #{print_time(test)} #{test}" } puts print_info(test_runner.exception) unless @client.connected? end
print_time(test)
click to toggle source
# File lib/minitest/reporters/ws/formatting.rb, line 9 def print_time(test) total_time = Time.now - (runner.test_start_time || Time.now) " (%.2fs)" % total_time end
print_with_info_padding(line)
click to toggle source
# File lib/minitest/reporters/ws/formatting.rb, line 78 def print_with_info_padding(line) puts pad(line, INFO_PADDING) end