class Libhoney::TestClient

A client with the network stubbed out for testing purposes. Does not actually send any events to Honeycomb; instead, records events for later inspection.

@note This class is intended for use in tests, for example if you want to

verify what events your instrumented code is sending. Use in
production is not recommended.

Public Class Methods

new(*args, **kwargs) click to toggle source
Calls superclass method Libhoney::Client::new
# File lib/libhoney/test_client.rb, line 13
def initialize(*args, **kwargs)
  super(*args, transmission: MockTransmissionClient.new, **kwargs)
end

Public Instance Methods

events() click to toggle source

@return [Array<Event>] the recorded events

# File lib/libhoney/test_client.rb, line 18
def events
  @transmission.events
end
reset() click to toggle source

Discards the recorded events

# File lib/libhoney/test_client.rb, line 23
def reset
  @transmission.reset
end