Sha256: 9d5b249faca0c64cbd911fc0e18b55733932388febcd675c7fccb9e3ae06a9b3

Contents?: true

Size: 634 Bytes

Versions: 4

Compression:

Stored size: 634 Bytes

Contents

require "spec_helper"

describe Logtail::LogEntry do
  let(:time) { Time.utc(2016, 9, 1, 12, 0, 0) }

  describe "#to_msgpack" do
    it "should encode properly with an event and context" do
      event = {
        message: "event_message",
        event: {
          event_type: {
            a: 1
          }
        }
      }
      context = {custom: {a: "b"}}
      log_entry = described_class.new("INFO", time, nil, "log message", context, event)
      msgpack = log_entry.to_msgpack
      expect(msgpack).to start_with("\x85\xA5level\xA4INFO\xA2dt\xBB2016-09-01T12:00:00.000000Z".force_encoding("ASCII-8BIT"))
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
logtail-0.1.0 spec/logtail/log_entry_spec.rb
logtail-ruby-0.1.2 spec/logtail/log_entry_spec.rb
logtail-ruby-0.1.1 spec/logtail/log_entry_spec.rb
logtail-ruby-0.1.0 spec/logtail/log_entry_spec.rb