- add a pure-defaults test

This commit is contained in:
Jordan Sissel 2012-10-15 16:36:06 -07:00
parent a3e2c67fd0
commit b74d143b0f

View file

@ -4,20 +4,37 @@ require "logstash/filters/csv"
describe LogStash::Filters::CSV do
extend LogStash::RSpec
describe "basics" do
describe "all defaults" do
# The logstash config goes here.
# At this time, only filters are supported.
config <<-CONFIG
filter {
csv { }
}
CONFIG
sample "big,bird,sesame street" do
insist { subject["field1"] } == "big"
insist { subject["field2"] } == "bird"
insist { subject["field3"] } == "sesame street"
end
end
describe "given fields" do
# The logstash config goes here.
# At this time, only filters are supported.
config <<-CONFIG
filter {
csv {
fields => ["first", "last", "zip" ]
fields => ["first", "last", "address" ]
}
}
CONFIG
sample "jordan,sissel,12345" do
p subject.to_hash
insist { subject["first"] } == "jordan"
sample "big,bird,sesame street" do
insist { subject["first"] } == "big"
insist { subject["last"] } == "bird"
insist { subject["address"] } == "sesame street"
end
end
end