Sha256: 47a32d5801f5d16d8848feb476e100e41ae1e94ca5b1e01687060bc13f51a309

Contents?: true

Size: 820 Bytes

Versions: 22

Compression:

Stored size: 820 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 = []
  TITLE_NAMES = []
  # Reset state between tests
  def self.clear_all
    ENDPOINT_NAMES.clear
    TITLE_NAMES.clear
  end

  def self.instrumenter
    Instrumenter
  end

  def self.instrument(category:, title:)
    TITLE_NAMES << 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

22 entries across 22 versions & 1 rubygems

Version Path
graphql-1.8.18 spec/support/skylight.rb
graphql-1.9.11 spec/support/skylight.rb
graphql-1.9.10 spec/support/skylight.rb
graphql-1.9.9 spec/support/skylight.rb
graphql-1.9.8 spec/support/skylight.rb
graphql-1.9.7 spec/support/skylight.rb
graphql-1.9.6 spec/support/skylight.rb
graphql-1.9.5 spec/support/skylight.rb
graphql-1.9.4 spec/support/skylight.rb
graphql-1.9.3 spec/support/skylight.rb
graphql-1.9.2 spec/support/skylight.rb
graphql-1.8.17 spec/support/skylight.rb
graphql-1.8.16 spec/support/skylight.rb
graphql-1.9.1 spec/support/skylight.rb
graphql-1.9.0 spec/support/skylight.rb
graphql-1.8.15 spec/support/skylight.rb
graphql-1.9.0.pre4 spec/support/skylight.rb
graphql-1.8.14 spec/support/skylight.rb
graphql-1.9.0.pre3 spec/support/skylight.rb
graphql-1.9.0.pre2 spec/support/skylight.rb