class XCPretty::TestAnything

Attributes

counter[R]

Public Class Methods

new(unicode, color) click to toggle source
Calls superclass method XCPretty::Formatter::new
# File lib/xcpretty/formatters/tap.rb, line 7
def initialize(unicode, color)
  super
  @counter = 0
end

Public Instance Methods

format_failing_test(test_suite, test_case, reason, file) click to toggle source
# File lib/xcpretty/formatters/tap.rb, line 17
def format_failing_test(test_suite, test_case, reason, file)
  increment_counter
  "#{FAIL} #{counter} - #{test_case}" +
  format_failure_diagnostics(test_suite, test_case, reason, file)
end
format_passing_test(suite, test_case, time) click to toggle source
# File lib/xcpretty/formatters/tap.rb, line 12
def format_passing_test(suite, test_case, time)
  increment_counter
  "#{PASS} #{counter} - #{test_case}"
end
format_pending_test(test_suite, test_case) click to toggle source
# File lib/xcpretty/formatters/tap.rb, line 23
def format_pending_test(test_suite, test_case)
  increment_counter
  "#{FAIL} #{counter} - #{test_case} # TODO Not written yet"
end
format_test_summary(executed_message, failures_per_suite) click to toggle source
# File lib/xcpretty/formatters/tap.rb, line 28
def format_test_summary(executed_message, failures_per_suite)
  counter > 0 ? "1..#{counter}" : ''
end

Private Instance Methods

increment_counter() click to toggle source
# File lib/xcpretty/formatters/tap.rb, line 34
def increment_counter
  @counter += 1
end