Commit 3b69684a authored by Igor's avatar Igor
Browse files

proper spec for exception logging

parent 43a19ee8
Loading
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ RSpec.shared_examples "a tracing instrumenter" do
      expected_tags.each do |name, value|
        expect(fake_span).to receive(:set_tag).with(name, value)
      end
      allow(fake_span).to receive(:set_tag).with("error", true)
      allow(fake_span).to receive(:set_tag)
      allow(fake_span).to receive(:log_kv)

      allow(fake_scope).to receive(:close)
@@ -54,7 +54,14 @@ RSpec.shared_examples "a tracing instrumenter" do
    end

    it "logs an exception on the span" do
      # ...
      allow(fake_span).to receive(:set_tag)

      expect(fake_span).to receive(:set_tag).with("error", true)
      expect(fake_span).to receive(:log_kv)

      allow(fake_scope).to receive(:close)

      instrumenter.finish("event name", "id", payload.merge(exception: StandardError.new))
    end
  end
end