<NME> test_split.rb
<BEF> ADDFILE
<MSG> Enabled LogStash to be built and tested on the Travis-CI Platform (travis-ci.org)

I removed the Gemfile.lock this lets travis-ci build without having to remove it or update it before running bundle install.

I added tests for the split filter. They test that the split filter behaves properly under default and non-default configuration.

I've disabled the following tests pending changes:
elasticsearch basic output
fifo file output

Squashed commit of the following:

commit fc9e2e61bad3f6c86ccba00a4a9fa4ad3e5e5030
Author: Nick Ethier <ncethier@gmail.com>
Date:   Thu Feb 9 13:21:48 2012 -0700

    housekeeping

commit 6cbeb2ded72a81e8e7b88b140a5796a35f21dbed
Author: Nick Ethier <ncethier@gmail.com>
Date:   Thu Feb 9 13:04:09 2012 -0700

    Added tests for the split filter

commit b54b9fca7ebc0b1963e71494374b46dd25e80916
Author: Nick Ethier <ncethier@gmail.com>
Date:   Thu Feb 9 00:19:39 2012 -0700

    Adjust grok performance limit

commit c0d810e6070dd94e9db94d86fa52feb6a5836d03
Author: Nick Ethier <ncethier@gmail.com>
Date:   Thu Feb 9 00:05:02 2012 -0700

    update deps, skip a couple tests until i can debug them, also set the file output test to flush after every event

commit b490b1e56dd6789dc4974e3010454184a4d6d352
Author: Nick Ethier <ncethier@gmail.com>
Date:   Wed Feb 8 20:59:15 2012 -0700

    more updates to make travis-ci happy

commit ab9cc6d76f7c6404d61e4c9374a4a92cc87a6642
Author: Nick Ethier <ncethier@gmail.com>
Date:   Wed Feb 8 20:33:21 2012 -0700

    Disabled file output test

commit ce8a45af222fd0030be37fdd174d5b7f34984e10
Author: Nick Ethier <ncethier@gmail.com>
Date:   Wed Feb 8 19:53:13 2012 -0700

    update lock before install

commit 99ad33f2d89db2068ba030fb9b16e0551e35bae6
Author: Nick Ethier <ncethier@gmail.com>
Date:   Wed Feb 8 19:49:41 2012 -0700

    add build image to readme

commit 0d7fa48acfca41b3d9de0e947d100a790c4cdb68
Author: Nick Ethier <ncethier@gmail.com>
Date:   Wed Feb 8 19:44:13 2012 -0700

    see if travis will work out of the box

<DFF> @@ -0,0 +1,137 @@
+require "rubygems"
+require File.join(File.dirname(__FILE__), "..", "minitest")
+
+require "logstash"
+require "logstash/filterworker"
+require "logstash/filters"
+require "logstash/filters/split"
+require "logstash/event"
+
+describe LogStash::Filters::Split do
+  before do
+    @typename = "split-test"
+  end
+
+  # TODO(sissel): Refactor this into a reusable method.
+  def config(cfg)
+    cfg["type"] = @typename
+    cfg.each_key do |key|
+      if !cfg[key].is_a?(Array)
+        cfg[key] = [cfg[key]]
+      end
+    end
+
+    @filter = LogStash::Filters::Split.new(cfg)
+    @filter.prepare_metrics
+  end
+
+  test "default behavior" do
+    config "type" => @typename
+
+    inputs = [
+      "one\ntwo",
+      "\nthree\nfour\n",
+      "five"
+    ]
+
+    expected_outputs = [
+      "one",
+      "two",
+      "three",
+      "four",
+      "five"
+    ]
+         
+    outputs = []
+
+    @filter_worker = LogStash::FilterWorker.new([@filter], nil, outputs)
+    @filter_worker.logger = LogStash::Logger.new(STDERR)
+    inputs.each do |input|
+      event = LogStash::Event.new
+      event.type = @typename
+      event.message = input
+      @filter_worker.filter(event)
+    end
+
+    assert_equal(expected_outputs.length, outputs.length,
+                 "Incorrect number of output events")
+    expected_outputs.zip(outputs).each do |expected, actual|
+      assert_equal(expected, actual.message)
+    end
+  end # test default behavior
+  
+  test "when field is set" do
+    config "type" => @typename, "field" => "@source"
+
+    inputs = [
+      "one\ntwo",
+      "\nthree\nfour\n",
+      "five"
+    ]
+
+    expected_outputs = [
+      "one",
+      "two",
+      "three",
+      "four",
+      "five"
+    ]
+         
+    outputs = []
+
+    @filter_worker = LogStash::FilterWorker.new([@filter], nil, outputs)
+    @filter_worker.logger = LogStash::Logger.new(STDERR)
+    inputs.each do |input|
+      event = LogStash::Event.new
+      event.type = @typename
+      event.message = "foo"
+      event.source = input
+      @filter_worker.filter(event)
+    end
+
+    assert_equal(expected_outputs.length, outputs.length,
+                 "Incorrect number of output events")
+    expected_outputs.zip(outputs).each do |expected, actual|
+      assert_equal(expected, actual.source)
+    end
+  end # test when field is set
+
+  test "when terminator is set" do
+    config "type" => @typename, "terminator" => "o"
+
+    inputs = [
+      "hello world",
+      "one + two",
+      "is four",
+      "five"
+    ]
+
+    expected_outputs = [
+      "hell",
+      " w",
+      "rld",
+      "ne + tw",
+      "is f",
+      "ur",
+      "five"
+    ]
+         
+    outputs = []
+
+    @filter_worker = LogStash::FilterWorker.new([@filter], nil, outputs)
+    @filter_worker.logger = LogStash::Logger.new(STDERR)
+    inputs.each do |input|
+      event = LogStash::Event.new
+      event.type = @typename
+      event.message = input
+      @filter_worker.filter(event)
+    end
+
+    assert_equal(expected_outputs.length, outputs.length,
+                 "Incorrect number of output events")
+    expected_outputs.zip(outputs).each do |expected, actual|
+      assert_equal(expected, actual.message)
+    end
+  end # test when terminator is set
+
+end # tests for LogStash::Filters::Split

Enabled LogStash to be built and tested on the Travis-CI Platform (travis-ci.org)