File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 3333
3434 context 'with custom_options configured for cee output' do
3535 before do
36- Lograge . formatter = -> ( data ) { "My test: #{ data } " }
36+ Lograge . formatter = -> ( data ) { "My test: #{ data . to_json } " }
3737 end
3838
3939 it 'combines the hash properly for the output' do
4040 Lograge . custom_options = { data : 'value' }
4141 subscriber . perform_action ( event )
42- expect ( log_output . string ) . to match ( /^My test: {.*: data=> "value"/ )
42+ expect ( log_output . string ) . to match ( /^My test: {.*" data" \s *: \s * "value"/ )
4343 end
4444
4545 it 'combines the output of a lambda properly' do
4646 Lograge . custom_options = -> ( _event ) { { data : 'value' } }
4747
4848 subscriber . perform_action ( event )
49- expect ( log_output . string ) . to match ( /^My test: {.*: data=> "value"/ )
49+ expect ( log_output . string ) . to match ( /^My test: {.*" data" \s *: \s * "value"/ )
5050 end
5151
5252 it 'works when the method returns nil' do
Original file line number Diff line number Diff line change 3939
4040 context 'with custom_options configured for cee output' do
4141 before do
42- Lograge . formatter = -> ( data ) { "My test: #{ data } " }
42+ Lograge . formatter = -> ( data ) { "My test: #{ data . to_json } " }
4343 end
4444
4545 it 'combines the hash properly for the output' do
4646 Lograge . custom_options = { data : 'value' }
4747 subscriber . process_action ( event )
48- expect ( log_output . string ) . to match ( /^My test: {.*: data=> "value"/ )
48+ expect ( log_output . string ) . to match ( /^My test: {.*" data" \s *: \s * "value"/ )
4949 end
5050
5151 it 'combines the output of a lambda properly' do
5252 Lograge . custom_options = -> ( _event ) { { data : 'value' } }
5353
5454 subscriber . process_action ( event )
55- expect ( log_output . string ) . to match ( /^My test: {.*: data=> "value"/ )
55+ expect ( log_output . string ) . to match ( /^My test: {.*" data" \s *: \s * "value"/ )
5656 end
5757
5858 it 'works when the method returns nil' do
You can’t perform that action at this time.
0 commit comments