<commit_before>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<commit_msg>Test for broadcasting to all sinks<commit_after>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
{'fraction_non_alphanumeric': 0.09345794392523364, 'fraction_numerical': 0.007009345794392523, 'mean_word_length': 4.86986301369863, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7547078', 'n_tokens_mistral': 284, 'n_tokens_neox': 271, 'n_words': 65}