require_relative 'spec_init'

describe "Detect Recorded Telemetry" do
  telemetry = Telemetry.new
  sink = Telemetry::Controls::Sink.example

  telemetry.register sink

  telemetry.record :something, 'some data'

  specify "With predicate" do
    assert(sink.recorded? { |r| r.name == :something })
  end

  specify "Without predicate" do
    assert(sink.recorded?)
  end
end

require_relative 'spec_init'

describe "Telemetry Broadcasts" do
  telemetry = Telemetry.new

  sink_1 = Telemetry::Controls::Sink::Macro.example
  sink_2 = Telemetry::Controls::Sink::Macro.example

  telemetry.register sink_1
  telemetry.register sink_2

  telemetry.record :something

  specify "To all its sinks" do
    assert(sink_1.recorded_something?)
    assert(sink_2.recorded_something?)
  end
end

Test for broadcasting to all sinks
Test for broadcasting to all sinks
