Skip to content

Commit

Permalink
- Add test to cover pull elastic#175 / LOGSTASH-528
Browse files Browse the repository at this point in the history
  • Loading branch information
jordansissel committed Aug 6, 2012
1 parent 4957f8b commit c23403f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/logstash/test_event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@
test "sprintf should join array fields by comma" do
@event.fields["foo"] = ["one", "two", "three"]
assert_equal(@event.fields["foo"].join(","), @event.sprintf("%{foo}"))
end # sprintf testing
end # sprintf array testing

test "sprintf should represent hash fields as json" do
@event.fields["foo"] = { "hello" => "world", "foo" => 123 }
assert_equal(@event.fields["foo"].to_json, @event.sprintf("%{foo}"))
end # sprintf hash formatting

test "sprintf should not error when a token does not exist" do
assert_equal("%{foo}", @event.sprintf("%{foo}"))
Expand Down

0 comments on commit c23403f

Please sign in to comment.