Sha256: f33f205c2d80ab4538b51cdf3a95a5322964c7922d10c8c272cfbacf2f4905f9

Contents?: true

Size: 668 Bytes

Versions: 15

Compression:

Stored size: 668 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})
      context = {custom: Timber::Contexts::Custom.new(type: :context_type, data: {b: 1})}
      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

15 entries across 15 versions & 1 rubygems

Version Path
timber-2.0.24 spec/timber/log_entry_spec.rb
timber-2.0.23 spec/timber/log_entry_spec.rb
timber-2.0.22 spec/timber/log_entry_spec.rb
timber-2.0.21 spec/timber/log_entry_spec.rb
timber-2.0.20 spec/timber/log_entry_spec.rb
timber-2.0.19 spec/timber/log_entry_spec.rb
timber-2.0.17 spec/timber/log_entry_spec.rb
timber-2.0.16 spec/timber/log_entry_spec.rb
timber-2.0.15 spec/timber/log_entry_spec.rb
timber-2.0.14 spec/timber/log_entry_spec.rb
timber-2.0.12 spec/timber/log_entry_spec.rb
timber-2.0.11 spec/timber/log_entry_spec.rb
timber-2.0.10 spec/timber/log_entry_spec.rb
timber-2.0.9 spec/timber/log_entry_spec.rb
timber-2.0.8 spec/timber/log_entry_spec.rb