Files
gentoo/dev-ruby/facter/files/facter-4.10.0-ruby34.patch
Alfred Wingate 78b6791ca2 dev-ruby/facter: enable ruby34, ruby40
Signed-off-by: Alfred Wingate <parona@protonmail.com>
Part-of: https://codeberg.org/gentoo/gentoo/pulls/1527
Signed-off-by: Sam James <sam@gentoo.org>
2026-07-26 16:06:27 +01:00

46 lines
1.5 KiB
Diff

--- a/spec/facter/facter_spec.rb
+++ b/spec/facter/facter_spec.rb
@@ -598,7 +598,12 @@ describe Facter do
context 'when exception and message are hashes' do
let(:message) { { 'a': 1 } }
let(:exception) { { 'b': 2 } }
- let(:expected_message) { '{:a=>1}' }
+ # https://bugs.ruby-lang.org/issues/20433
+ if RUBY_VERSION >= '3.4'
+ let(:expected_message) { '{a: 1}' }
+ else
+ let(:expected_message) { '{:a=>1}' }
+ end
it_behaves_like 'when exception param is not an exception'
end
@@ -682,7 +687,12 @@ describe Facter do
context 'when exception and message are hashes' do
let(:message) { { 'a': 1 } }
let(:exception) { { 'b': 2 } }
- let(:expected_message) { '{:a=>1}' }
+ # https://bugs.ruby-lang.org/issues/20433
+ if RUBY_VERSION >= '3.4'
+ let(:expected_message) { '{a: 1}' }
+ else
+ let(:expected_message) { '{:a=>1}' }
+ end
it_behaves_like 'when exception param is not an exception'
end
@@ -808,7 +818,12 @@ describe Facter do
end
it 'when message is a hash' do
- expect(logger).to receive(:warn).with('{:warn=>"message"}')
+ # https://bugs.ruby-lang.org/issues/20433
+ if RUBY_VERSION >= '3.4'
+ expect(logger).to receive(:warn).with('{warn: "message"}')
+ else
+ expect(logger).to receive(:warn).with('{:warn=>"message"}')
+ end
Facter.warn({ warn: 'message' })
end