mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 04:59:14 -07:00
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>
This commit is contained in:
committed by
Sam James
parent
2c05ec7d90
commit
78b6791ca2
@@ -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() {
|
||||
|
||||
45
dev-ruby/facter/files/facter-4.10.0-ruby34.patch
Normal file
45
dev-ruby/facter/files/facter-4.10.0-ruby34.patch
Normal file
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user