Sha256: b439d38c3b845ff96cbcfe538a492aa558c0298c2d4788245b831da80883784b

Contents?: true

Size: 754 Bytes

Versions: 7

Compression:

Stored size: 754 Bytes

Contents

# frozen_string_literal: true
# A stub for the Skylight agent, so we can make assertions about how it is used
# Based on:
#  - https://www.rubydoc.info/gems/skylight-core/2.0.2
#  - https://www.rubydoc.info/gems/skylight/2.0.2
if defined?(Skylight)
  raise "Expected Skylight to be undefined, so that we could define a stub for it."
end

module Skylight
  ENDPOINT_NAMES = []
  # Reset state between tests
  def self.clear_all
    ENDPOINT_NAMES.clear
  end

  def self.instrumenter
    Instrumenter
  end

  def self.instrument(category:, title:)
    yield
  end

  module Instrumenter
    def self.current_trace
      CurrentTrace
    end
  end

  module CurrentTrace
    def self.endpoint=(endpoint)
      ENDPOINT_NAMES << endpoint
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
graphql-1.9.0.pre1 spec/support/skylight.rb
graphql-1.8.11 spec/support/skylight.rb
graphql-1.8.10 spec/support/skylight.rb
graphql-1.8.9 spec/support/skylight.rb
graphql-1.8.8 spec/support/skylight.rb
graphql-1.8.7 spec/support/skylight.rb
graphql-1.8.6 spec/support/skylight.rb