Sha256: 8cb1e0ff11c2f625dbd49ab681569faf2baed38dd30a658d8c98793db222a576

Contents?: true

Size: 930 Bytes

Versions: 1

Compression:

Stored size: 930 Bytes

Contents

require "spec_helper"

module Fonte
  module Parsers
    describe LogParser do
      let(:parser) { described_class.new }

      subject { parser.parse(text) }

      describe "entry" do
        let(:text) { 'L 12/26/2011 - 02:14:29: Loading map "c4m2_sugarmill_a"' }
        it { should be }

        describe "time" do
          subject { parser.parse(text).date_time }
          it { should be }
        end

        describe "command" do
          subject { parser.parse(text).command }
          it { should be }
        end

        context "when there are garbage before the log line" do
          let(:text) { '????RL 12/26/2011 - 02:14:29: Loading map "c4m2_sugarmill_a"' }
          it { should be }
        end

        context "when there is a line break after the log line" do
          let(:text) { "L 12/26/2011 - 02:14:29: server cvars start\n" }
          it { should be }
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fonte-0.2.0 spec/parsers/log_parser_spec.rb