Sha256: 64fccd1a58998f4d7933d3e33facb57422c8d592d08e8ba9ab2c3acccdfbdba6

Contents?: true

Size: 548 Bytes

Versions: 2

Compression:

Stored size: 548 Bytes

Contents

require 'spec_helper'

describe FluQ::Format::Tsv do

  let(:data) { %(1313131313\t{"a":"b"}\n1313131313\t{"a":"b"}\n1313131313\t{"a":"b"}\n) }

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

  it 'should parse' do
    events = subject.parse(data)
    events.should have(3).items
    events.first.should == FluQ::Event.new({"a" => "b"}, 1313131313)
  end

  it 'should log invalid inputs' do
    subject.logger.should_receive(:warn).once
    events = subject.parse data + %(NOTTSV\n1313131313\t{"a":"b"}\n\n)
    events.should have(4).items
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

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