class RspecLogfmtFormatter::Formatter

Attributes

retries[R]
started[R]

Public Instance Methods

dump_summary(notification) click to toggle source
# File lib/rspec_logfmt_formatter/formatter.rb, line 24
def dump_summary(notification)
  @summary_notification = notification
  fmt_dump
end
retry(example) click to toggle source
# File lib/rspec_logfmt_formatter/formatter.rb, line 29
def retry(example)
  @retries << example
end
start(notification) click to toggle source
Calls superclass method
# File lib/rspec_logfmt_formatter/formatter.rb, line 13
def start(notification)
  @start_notification = notification
  @started = Time.now
  @retries = []
  super
end
stop(notification) click to toggle source
# File lib/rspec_logfmt_formatter/formatter.rb, line 20
def stop(notification)
  @examples_notification = notification
end

Private Instance Methods

duration() click to toggle source
# File lib/rspec_logfmt_formatter/formatter.rb, line 49
def duration
  @summary_notification.duration
end
error_count() click to toggle source
# File lib/rspec_logfmt_formatter/formatter.rb, line 53
def error_count
  if @summary_notification.respond_to?(:errors_outside_of_examples_count)
    @summary_notification.errors_outside_of_examples_count
  else
    0
  end
end
example_count() click to toggle source
# File lib/rspec_logfmt_formatter/formatter.rb, line 37
def example_count
  @summary_notification.example_count
end
failure_count() click to toggle source
# File lib/rspec_logfmt_formatter/formatter.rb, line 45
def failure_count
  @summary_notification.failure_count
end
fmt_dump() click to toggle source

rubocop:disable Metrics/AbcSize

# File lib/rspec_logfmt_formatter/formatter.rb, line 62
def fmt_dump
  output << %( tests.name="rspec#{ENV['TEST_ENV_NUMBER']}")
  output << %( tests.count="#{example_count}")
  output << %( tests.skipped="#{pending_count}")
  output << %( tests.failures="#{failure_count}")
  output << %( tests.errors="#{error_count}")
  output << %( tests.retries.count="#{retries.size}")
end
pending_count() click to toggle source
# File lib/rspec_logfmt_formatter/formatter.rb, line 41
def pending_count
  @summary_notification.pending_count
end