spec/formatters/readable_spec.rb in ougai-1.6.3 vs spec/formatters/readable_spec.rb in ougai-1.6.4
- old
+ new
@@ -20,10 +20,23 @@
}
end
let(:formatter) { described_class.new }
+ include_examples 'formatter#initialize',
+ default_opts: {
+ trace_indent: 4,
+ trace_max_lines: 100,
+ serialize_backtrace: true,
+ plain: false,
+ excluded_fields: []
+ },
+ options: {
+ plain: true,
+ excluded_fields: [:card_number]
+ }
+
context 'when severity is TRACE' do
subject { formatter.call('TRACE', Time.now, nil, data) }
it 'includes valid strings' do
expect(subject).to match(re_start_with_datetime)
@@ -116,8 +129,14 @@
end
it 'applys output' do
expect(subject).to match(/^\[\d{2}:\d{2}:\d{2} [AP]M\]/)
end
+ end
+ end
+
+ describe '#serialize_backtrace' do
+ it 'is not supported' do
+ expect{ formatter.serialize_backtrace = false }.to raise_error(NotImplementedError)
end
end
end