Skip to content

Commit

Permalink
Merge pull request #1074 from fluent/omit-jsonize-non-container-values
Browse files Browse the repository at this point in the history
Just a single value was invalid as JSON object in traditional way
  • Loading branch information
tagomoris authored Jul 4, 2016
2 parents 85239fb + b5c619c commit b0c2bc2
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions test/test_event_time.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,18 @@ class EventTimeTest < Test::Unit::TestCase

test 'JSON.dump' do
time = Fluent::EventTime.new(100)
assert_equal('100', JSON.dump(time))
assert_equal('{"time":100}', JSON.dump({'time' => time}))
assert_equal('["tag",100,{"key":"value"}]', JSON.dump(["tag", time, {"key" => "value"}]))
end

test 'Oj.dump' do
time = Fluent::EventTime.new(100)
assert_equal('100', Oj.dump(time, mode: :compat))
assert_equal('{"time":100}', Oj.dump({'time' => time}, mode: :compat))
assert_equal('["tag",100,{"key":"value"}]', Oj.dump(["tag", time, {"key" => "value"}], mode: :compat))
end

test 'Yajl.dump' do
time = Fluent::EventTime.new(100)
assert_equal('100', Yajl.dump(time))
assert_equal('{"time":100}', Yajl.dump({'time' => time}))
assert_equal('["tag",100,{"key":"value"}]', Yajl.dump(["tag", time, {"key" => "value"}]))
end
Expand Down

0 comments on commit b0c2bc2

Please sign in to comment.