test/unit/logging_tests.rb in deas-0.17.1 vs test/unit/logging_tests.rb in deas-0.18.0
- old
+ new
@@ -48,24 +48,40 @@
class SummaryLineTests < BaseTests
desc "Deas::SummaryLine"
subject{ Deas::SummaryLine }
should "output its attributes in a specific order" do
- assert_equal %w{time status method path handler params}, subject.keys
+ assert_equal %w{time status method path handler params redir}, subject.keys
end
should "output its attributes in a single line" do
line_attrs = {
- 'time' => 't',
- 'status' => 's',
- 'method' => 'm',
- 'path' => 'pth',
+ 'time' => 't',
+ 'status' => 's',
+ 'method' => 'm',
+ 'path' => 'pth',
'handler' => 'h',
- 'params' => 'p',
+ 'params' => 'p',
+ 'redir' => 'r'
}
exp_line = "time=\"t\" "\
"status=\"s\" "\
"method=\"m\" "\
+ "path=\"pth\" "\
+ "handler=\"h\" "\
+ "params=\"p\" "\
+ "redir=\"r\""
+ assert_equal exp_line, subject.new(line_attrs)
+ end
+
+ should "only output keys if data exists for them" do
+ line_attrs = {
+ 'status' => 's',
+ 'path' => 'pth',
+ 'handler' => 'h',
+ 'params' => 'p'
+ }
+ exp_line = "status=\"s\" "\
"path=\"pth\" "\
"handler=\"h\" "\
"params=\"p\""
assert_equal exp_line, subject.new(line_attrs)
end