diff --git a/dev-ruby/facter/facter-4.10.0-r1.ebuild b/dev-ruby/facter/facter-4.10.0-r1.ebuild index 400406dfd732b..819068b56860b 100644 --- a/dev-ruby/facter/facter-4.10.0-r1.ebuild +++ b/dev-ruby/facter/facter-4.10.0-r1.ebuild @@ -2,7 +2,7 @@ # Distributed under the terms of the GNU General Public License v2 EAPI=8 -USE_RUBY="ruby32 ruby33" +USE_RUBY="ruby32 ruby33 ruby34 ruby40" RUBY_FAKEGEM_GEMSPEC="facter.gemspec" RUBY_FAKEGEM_RECIPE_TEST="rspec3" RUBY_FAKEGEM_RECIPE_DOC="yard" @@ -33,6 +33,7 @@ ruby_add_bdepend "test? ( dev-ruby/simplecov dev-ruby/timecop dev-ruby/webmock ) PATCHES=( "${FILESDIR}"/facter-4.7.0-gentoo-thor-gemspec.patch "${FILESDIR}"/facter-4.10.0-gentoo-os-release.patch + "${FILESDIR}"/facter-4.10.0-ruby34.patch ) src_unpack() { diff --git a/dev-ruby/facter/files/facter-4.10.0-ruby34.patch b/dev-ruby/facter/files/facter-4.10.0-ruby34.patch new file mode 100644 index 0000000000000..5946e5cb34f2b --- /dev/null +++ b/dev-ruby/facter/files/facter-4.10.0-ruby34.patch @@ -0,0 +1,45 @@ +--- 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 +