Repair outputs/file test + add use of zcat command to cover LOGSTASH-997

This commit is contained in:
Wiibaa 2013-09-11 14:39:14 +02:00
parent 388ee8a0ab
commit edded01ab8

View file

@ -29,7 +29,7 @@ describe LogStash::Outputs::File do
# Now check all events for order and correctness.
File.foreach(tmp_file) do |line|
event = LogStash::Event.from_json(line)
insist {event.message} == "hello world"
insist {event["message"]} == "hello world"
insist {event["sequence"]} == line_num
line_num += 1
end
@ -62,7 +62,17 @@ describe LogStash::Outputs::File do
# Now check all events for order and correctness.
Zlib::GzipReader.new(File.open(tmp_file)).each_line do |line|
event = LogStash::Event.from_json(line)
insist {event.message} == "hello world"
insist {event["message"]} == "hello world"
insist {event["sequence"]} == line_num
line_num += 1
end
insist {line_num} == event_count
#LOGSTASH-997 confirm usage of zcat command on file
line_num = 0
`zcat #{tmp_file.path()}`.split("\n").each do |line|
event = LogStash::Event.from_json(line)
insist {event["message"]} == "hello world"
insist {event["sequence"]} == line_num
line_num += 1
end