Skip to content

Commit

Permalink
Repair outputs/file test + add use of zcat command to cover LOGSTASH-997
Browse files Browse the repository at this point in the history
  • Loading branch information
wiibaa committed Sep 11, 2013
1 parent 388ee8a commit edded01
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions spec/outputs/file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# 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
Expand Down Expand Up @@ -62,7 +62,17 @@
# 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
Expand Down

0 comments on commit edded01

Please sign in to comment.