spec/json_formatter_spec.rb in lumber-1.1.3 vs spec/json_formatter_spec.rb in lumber-1.2.0
- old
+ new
@@ -19,11 +19,11 @@
formatter:
type: JsonFormatter
EOF
cfg = Log4r::YamlConfigurator
- cfg.load_yaml_string(yml)
+ cfg.load_yaml_string(clean_indent(yml))
outputter = Log4r::Outputter['stdout']
outputter.formatter.should_not be_nil
outputter.formatter.should be_a_kind_of Lumber::JsonFormatter
end
@@ -45,11 +45,11 @@
level: severity
backtrace: exception.bt
EOF
cfg = Log4r::YamlConfigurator
- cfg.load_yaml_string(yml)
+ cfg.load_yaml_string(clean_indent(yml))
outputter = Log4r::Outputter['stdout']
outputter.formatter.should_not be_nil
outputter.formatter.should be_a_kind_of Lumber::JsonFormatter
outputter.formatter.instance_variable_get(:@key_mapping).should eq({'level' => ['severity'], 'backtrace' => ['exception', 'bt']})
end
@@ -72,11 +72,11 @@
version: 1
dynamic: "#{1+1}"
EOF
yml.should include('#{1+1}')
cfg = Log4r::YamlConfigurator
- cfg.load_yaml_string(yml)
+ cfg.load_yaml_string(clean_indent(yml))
outputter = Log4r::Outputter['stdout']
outputter.formatter.should_not be_nil
outputter.formatter.should be_a_kind_of Lumber::JsonFormatter
outputter.formatter.instance_variable_get(:@fields).should eq({'version' => 1, 'dynamic' => '2'})
end
@@ -96,10 +96,10 @@
formatter:
type: JsonFormatter
date_pattern: "%M"
EOF
cfg = Log4r::YamlConfigurator
- cfg.load_yaml_string(yml)
+ cfg.load_yaml_string(clean_indent(yml))
outputter = Log4r::Outputter['stdout']
outputter.formatter.should_not be_nil
outputter.formatter.should be_a_kind_of Lumber::JsonFormatter
outputter.formatter.instance_variable_get(:@date_pattern).should == "%M"
end