Skip to content

Commit 932953d

Browse files
committed
ci: Fix Ruby-3.4 failures due to change in #inspect
> chruby ruby-3.4 > ruby -e 'puts({ a: 42, "b" => 161 }.inspect)' {a: 42, "b" => 161} > chruby ruby-3.3 > ruby -e 'puts({ a: 42, "b" => 161 }.inspect)' {:a=>42, "b"=>161} > chruby ruby-3.2 > ruby -e 'puts({ a: 42, "b" => 161 }.inspect)' {:a=>42, "b"=>161} See: httprb/http#808 (comment)
1 parent b4c794d commit 932953d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

spec/log_subscribers/action_cable_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,20 @@
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

spec/log_subscribers/action_controller_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,20 @@
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

0 commit comments

Comments
 (0)