Sha256: a9a6932cbce87e8b68792376fef8266066e1884804adb3b0b542d2694f35180b

Contents?: true

Size: 714 Bytes

Versions: 28

Compression:

Stored size: 714 Bytes

Contents

require "spec_helper"

describe Timber::LogEntry, :rails_23 => true 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 = Timber::Events::Custom.new(type: :event_type, message: "event_message", data: {a: 1})
      custom_context = Timber::Contexts::Custom.new(type: :context_type, data: {b: 1})
      context = {custom: custom_context.as_json}
      log_entry = described_class.new("INFO", time, nil, "log message", context, event)
      msgpack = log_entry.to_msgpack
      expect(msgpack).to start_with("\x86\xA5level\xA4INFO\xA2dt\xBB2016-09-01T12:00:00.000000Z".force_encoding("ASCII-8BIT"))
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
timber-2.6.2 spec/timber/log_entry_spec.rb
timber-2.6.1 spec/timber/log_entry_spec.rb
timber-2.6.0 spec/timber/log_entry_spec.rb
timber-2.6.0.pre.beta2 spec/timber/log_entry_spec.rb
timber-2.6.0.pre.beta1 spec/timber/log_entry_spec.rb
timber-2.3.1 spec/timber/log_entry_spec.rb
timber-2.3.0 spec/timber/log_entry_spec.rb
timber-2.2.3 spec/timber/log_entry_spec.rb
timber-2.2.2 spec/timber/log_entry_spec.rb
timber-2.2.1 spec/timber/log_entry_spec.rb
timber-2.2.0 spec/timber/log_entry_spec.rb
timber-2.1.10 spec/timber/log_entry_spec.rb
timber-2.1.9 spec/timber/log_entry_spec.rb
timber-2.1.8 spec/timber/log_entry_spec.rb
timber-2.1.7 spec/timber/log_entry_spec.rb
timber-2.1.6 spec/timber/log_entry_spec.rb
timber-2.1.5 spec/timber/log_entry_spec.rb
timber-2.1.4 spec/timber/log_entry_spec.rb
timber-2.1.3 spec/timber/log_entry_spec.rb
timber-2.1.2 spec/timber/log_entry_spec.rb