Sha256: 244e9a15970f7f16debc7e0454e857408c50c443dca6bd20a8e05a7900cc2d2b

Contents?: true

Size: 601 Bytes

Versions: 2

Compression:

Stored size: 601 Bytes

Contents

require 'spec_helper'

describe FluQ::Format::Msgpack do

  let(:data) { ([{"a" => "b"}] * 3).map {|h| MessagePack.pack(h) }.join }

  it { should be_a(FluQ::Format::Base) }

  it 'should parse' do
    events = subject.parse(data)
    events.should have(3).items
    events.first.timestamp.should be_within(5).of(Time.now.to_i)
    events.first.should == FluQ::Event.new({"a" => "b"}, events.first.timestamp)
  end

  it 'should log invalid inputs' do
    subject.logger.should_receive(:warn).at_least(:once)
    events = subject.parse data + "NOTMP" + data
    events.should have(6).items
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fluq-0.8.1 spec/fluq/format/msgpack_spec.rb
fluq-0.8.0 spec/fluq/format/msgpack_spec.rb