Sha256: b4910ce205e69f11f1be33afb64ad9dd4e3e191ff684f6ddfc1f44af925e63fb

Contents?: true

Size: 696 Bytes

Versions: 7

Compression:

Stored size: 696 Bytes

Contents

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

    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

7 entries across 7 versions & 1 rubygems

Version Path
rspec-buildkite-analytics-0.3.5 lib/rspec/buildkite/analytics/reporter.rb
rspec-buildkite-analytics-0.3.4 lib/rspec/buildkite/analytics/reporter.rb
rspec-buildkite-analytics-0.3.3 lib/rspec/buildkite/analytics/reporter.rb
rspec-buildkite-analytics-0.3.2 lib/rspec/buildkite/analytics/reporter.rb
rspec-buildkite-analytics-0.3.1 lib/rspec/buildkite/analytics/reporter.rb
rspec-buildkite-analytics-0.3.0 lib/rspec/buildkite/analytics/reporter.rb
rspec-buildkite-analytics-0.2.0 lib/rspec/buildkite/analytics/reporter.rb