Sha256: b8827e47dd891349cb7dca563ab1a2abae5c2a8f96aca7addf394c4face46b8c

Contents?: true

Size: 721 Bytes

Versions: 1

Compression:

Stored size: 721 Bytes

Contents

module RSpec::Buildkite::Analytics
  class Reporter
    RSpec::Core::Formatters.register self, :example_passed, :example_failed, :example_pending

    attr_reader :output

    def initialize(output)
      @output = output
    end

    def handle_example(notification)
      example = notification.example
      trace = RSpec::Buildkite::Analytics.uploader.traces.find do |trace|
        example.id == trace.example.id
      end

      if trace
        trace.example = example
        RSpec::Buildkite::Analytics.session&.write_result(trace)
      end
    end

    alias_method :example_passed, :handle_example
    alias_method :example_failed, :handle_example
    alias_method :example_pending, :handle_example
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rspec-buildkite-analytics-0.3.6 lib/rspec/buildkite/analytics/reporter.rb