spec/codecs/avro_spec.rb in logstash-codec-avro-0.1.3 vs spec/codecs/avro_spec.rb in logstash-codec-avro-0.1.4

- old
+ new

@@ -34,18 +34,19 @@ end context "#encode" do it "should return avro data from a LogStash::Event" do got_event = false - subject.on_event do |data| + subject.on_event do |event, data| schema = Avro::Schema.parse(avro_config['schema_uri']) datum = StringIO.new(data) decoder = Avro::IO::BinaryDecoder.new(datum) datum_reader = Avro::IO::DatumReader.new(schema) record = datum_reader.read(decoder) insist { record["foo"] } == test_event["foo"] insist { record["bar"] } == test_event["bar"] + insist { event.is_a? LogStash::Event } got_event = true end subject.encode(test_event) insist { got_event } end