json_logger_formatter 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -10,6 +10,13 @@ describe JsonLoggerFormatter::Formatter do
|
|
10
10
|
l.formatter = JsonLoggerFormatter::Formatter
|
11
11
|
l.info({a: 'foo', b: 'bar'})
|
12
12
|
l.error({c: 'baz', d: 'quux'})
|
13
|
-
|
13
|
+
expected = [{"severity" => "INFO","time" => "",
|
14
|
+
"msg" => {"a" => "foo","b" => "bar"}},
|
15
|
+
{"severity" => "ERROR","time" => "",
|
16
|
+
"msg" => {"c" => "baz","d" => "quux"}}]
|
17
|
+
s.string.split("\n").map {|l| JSON.parse(l)}.zip(expected).each do |l|
|
18
|
+
l[0]["time"] = ""
|
19
|
+
expect(l[1]).to eq(l[0])
|
20
|
+
end
|
14
21
|
end
|
15
22
|
end
|