Merge branch 'imap_header_repetition' of https://github.com/colinsurprenant/logstash into colinsurprenant-imap_header_repetition

Conflicts:
	lib/logstash/inputs/imap.rb
This commit is contained in:
Jordan Sissel 2014-03-18 15:35:02 -07:00
commit 61c2fdd765

View file

@ -59,4 +59,30 @@ describe LogStash::Inputs::IMAP do
end
end
context "with multiple values for same header" do
it "should add 2 values as array in event" do
msg.received = "test1"
msg.received = "test2"
config = {"type" => "imap", "host" => "localhost",
"user" => "#{user}", "password" => "#{password}"}
input = LogStash::Inputs::IMAP.new config
input.register
event = input.parse_mail(msg)
insist { event["received"] } == ["test1", "test2"]
end
it "should add more than 2 values as array in event" do
msg.received = "test3"
config = {"type" => "imap", "host" => "localhost",
"user" => "#{user}", "password" => "#{password}"}
input = LogStash::Inputs::IMAP.new config
input.register
event = input.parse_mail(msg)
insist { event["received"] } == ["test1", "test2", "test3"]
end
end
end