File: composite_reporter_spec.rb

package info (click to toggle)
ruby-jaeger-client 1.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 624 kB
  • sloc: ruby: 3,381; makefile: 6; sh: 4
file content (17 lines) | stat: -rw-r--r-- 557 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
require 'spec_helper'

RSpec.describe Jaeger::Reporters::CompositeReporter do
  let(:reporter) { described_class.new(reporters: [reporter1, reporter2]) }
  let(:reporter1) { instance_spy(Jaeger::Reporters::InMemoryReporter) }
  let(:reporter2) { instance_spy(Jaeger::Reporters::RemoteReporter) }

  describe '#report' do
    it 'forwards span to all reporters' do
      span = build_span
      reporter.report(span)

      expect(reporter1).to have_received(:report).with(span)
      expect(reporter2).to have_received(:report).with(span)
    end
  end
end