Skip to content

Commit

Permalink
chore: Add logger provider on emit test
Browse files Browse the repository at this point in the history
  • Loading branch information
kaylareopelle committed May 14, 2024
1 parent 1f9f902 commit 89bf4fc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions logs_sdk/test/opentelemetry/sdk/logs/logger_provider_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,18 @@
end
end
end

describe '#on_emit' do
it 'sends the log record to the processors' do
mock_log_record = Minitest::Mock.new
mock_context = Minitest::Mock.new
def mock_context.value(key); OpenTelemetry::Trace::Span::INVALID; end

logger_provider.add_log_record_processor(mock_log_record_processor)
mock_log_record_processor.expect(:on_emit, nil, [mock_log_record, mock_context])

logger_provider.on_emit(mock_log_record, mock_context)
mock_log_record_processor.verify
end
end
end

0 comments on commit 89bf4fc

Please sign in to comment.