Skip to content

Commit ec5b1fb

Browse files
smortexbastelfreak
authored andcommitted
Fix CI for Ruby 3.4
In Ruby 3.4, Hash#inspect rendering have been changed: https://bugs.ruby-lang.org/issues/20433 Some tests depend on the way hashes are serialized, so instead of hardcoding them, ask the test suite to do it for us and use that to assert the right value is passed around in tests.
1 parent e207154 commit ec5b1fb

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

spec/facter/facter_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ def stub_no_fact
598598
context 'when exception and message are hashes' do
599599
let(:message) { { 'a': 1 } }
600600
let(:exception) { { 'b': 2 } }
601-
let(:expected_message) { '{:a=>1}' }
601+
let(:expected_message) { { a: 1 }.to_s }
602602

603603
it_behaves_like 'when exception param is not an exception'
604604
end
@@ -682,7 +682,7 @@ def stub_no_fact
682682
context 'when exception and message are hashes' do
683683
let(:message) { { 'a': 1 } }
684684
let(:exception) { { 'b': 2 } }
685-
let(:expected_message) { '{:a=>1}' }
685+
let(:expected_message) { { a: 1 }.to_s }
686686

687687
it_behaves_like 'when exception param is not an exception'
688688
end
@@ -808,7 +808,7 @@ def stub_no_fact
808808
end
809809

810810
it 'when message is a hash' do
811-
expect(logger).to receive(:warn).with('{:warn=>"message"}')
811+
expect(logger).to receive(:warn).with({ warn: 'message' }.to_s)
812812

813813
Facter.warn({ warn: 'message' })
814814
end

0 commit comments

Comments
 (0)