<NME> spool.rb
<BEF> ADDFILE
<MSG> start codec tests

<DFF> @@ -0,0 +1,33 @@
+require "logstash/codecs/spool"
+require "logstash/event"
+require "insist"
+
+describe LogStash::Codecs::Spool do
+  subject do
+    next LogStash::Codecs::Spool.new
+  end
+
+  context "#decode" do
+    it "should return multiple spooled events" do
+      e1 = LogStash::Event.new
+      e2 = LogStash::Event.new
+      e3 = LogStash::Event.new
+      subject.decode([e1,e2,e3]) do |event|
+        insist { event.is_a? LogStash::Event }
+      end
+    end
+  end
+
+  context "#encode" do
+    it "should return a spooled event" do
+      got_event = false
+      subject.on_event do |data|
+        got_event = true
+      end
+      50.times do
+        subject.encode(LogStash::Event.new)
+      end
+      insist { got_event }
+    end
+  end
+end

start codec tests