Skip to content

Commit

Permalink
- add a pure-defaults test
Browse files Browse the repository at this point in the history
  • Loading branch information
jordansissel committed Oct 15, 2012
1 parent a3e2c67 commit b74d143
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions spec/filters/csv.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,37 @@
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

0 comments on commit b74d143

Please sign in to comment.