Sha256: 6b7bf49dc1cd6a94e6597ad926e131d46c020457b28b60e6825c81849fd63c36

Contents?: true

Size: 541 Bytes

Versions: 2

Compression:

Stored size: 541 Bytes

Contents

require 'spec_helper'
require 'lograge_tagged'

describe LogrageTagged::LogSubscriber do

  subject { LogrageLogSubscriber.new }
  
  LogrageLogSubscriber = Class.new do
    include LogrageTagged::LogSubscriber
    def process_action_lograge(payload)
      payload.map { |k,v| "#{k}=#{v}" }.join(" ")
    end
  end

  describe "#process_action_tagged" do
    it "prepends the tag to the processed payload" do
      line = subject.process_action_tagged(foo: "1", bar: "2")
      line.should eq("[request.app] foo=1 bar=2")
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lograge-tagged-0.1.1 spec/lograge_tagged_spec.rb
lograge-tagged-0.1.0 spec/lograge_tagged_spec.rb