Sha256: 7778427f76caacfcd84bb0f34a00d0fae7f39a9a76e075641aac5dfce85438c1

Contents?: true

Size: 831 Bytes

Versions: 26

Compression:

Stored size: 831 Bytes

Contents

module XCPretty

  class TestAnything < Knock

    attr_reader :counter

    def initialize(unicode, color)
      super
      @counter = 0
    end

    def format_passing_test(suite, test_case, time)
      increment_counter
      "#{PASS} #{counter} - #{test_case}"
    end

    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

    def format_pending_test(test_suite, test_case)
      increment_counter
      "#{FAIL} #{counter} - #{test_case} # TODO Not written yet"
    end

    def format_test_summary(executed_message, failures_per_suite)
      counter > 0 ? "1..#{counter}" : ''
    end

    private

    def increment_counter
      @counter += 1
    end
  end

end

Version data entries

26 entries across 26 versions & 3 rubygems

Version Path
xcpretty-0.4.0 lib/xcpretty/formatters/tap.rb
xcpretty-security-patched-0.3.2 lib/xcpretty/formatters/tap.rb
xcpretty-security-patched-0.3.0 lib/xcpretty/formatters/tap.rb
xcpretty-0.3.0 lib/xcpretty/formatters/tap.rb
xcpretty-0.2.8 lib/xcpretty/formatters/tap.rb
xcpretty-0.2.7 lib/xcpretty/formatters/tap.rb
xcpretty-0.2.6 lib/xcpretty/formatters/tap.rb
xcpretty-0.2.4 lib/xcpretty/formatters/tap.rb
xcpretty-0.2.3 lib/xcpretty/formatters/tap.rb
xcpretty-bb-0.1.12.bb14 lib/xcpretty/formatters/tap.rb
xcpretty-bb-0.1.12.bb13 lib/xcpretty/formatters/tap.rb
xcpretty-bb-0.1.12.bb12 lib/xcpretty/formatters/tap.rb
xcpretty-bb-0.1.12.bb11 lib/xcpretty/formatters/tap.rb
xcpretty-bb-0.1.12.bb10 lib/xcpretty/formatters/tap.rb
xcpretty-bb-0.1.12.bb9 lib/xcpretty/formatters/tap.rb
xcpretty-bb-0.1.12.bb8 lib/xcpretty/formatters/tap.rb
xcpretty-0.2.2 lib/xcpretty/formatters/tap.rb
xcpretty-bb-0.1.12.bb7 lib/xcpretty/formatters/tap.rb
xcpretty-0.2.1 lib/xcpretty/formatters/tap.rb
xcpretty-bb-0.1.12.bb6 lib/xcpretty/formatters/tap.rb