From c356e3c8e27b49717a78b8fd282d3b170dae5f9a Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Thu, 17 Aug 2023 17:34:45 +0200 Subject: [PATCH 1/2] modulesync 7.0.0 --- .github/CONTRIBUTING.md | 11 +++++++---- .msync.yml | 2 +- Gemfile | 2 +- spec/spec_helper.rb | 1 + spec/spec_helper_acceptance.rb | 2 +- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 8b466cfb..6aaa603f 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -232,18 +232,21 @@ simple tests against it after applying the module. You can run this with: ```sh -BEAKER_setfile=debian11-64 bundle exec rake beaker +BEAKER_PUPPET_COLLECTION=puppet7 BEAKER_setfile=debian11-64 bundle exec rake beaker ``` -You can replace the string `debian10` with any common operating system. +You can replace the string `debian11` with any common operating system. The following strings are known to work: -* ubuntu1804 * ubuntu2004 -* debian10 +* ubuntu2204 * debian11 * centos7 * centos8 +* centos9 +* almalinux8 +* almalinux9 +* fedora36 For more information and tips & tricks, see [voxpupuli-acceptance's documentation](https://github.com/voxpupuli/voxpupuli-acceptance#running-tests). diff --git a/.msync.yml b/.msync.yml index b929160c..dd3e9572 100644 --- a/.msync.yml +++ b/.msync.yml @@ -2,4 +2,4 @@ # Managed by modulesync - DO NOT EDIT # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ -modulesync_config_version: '6.0.0' +modulesync_config_version: '7.0.0' diff --git a/Gemfile b/Gemfile index 98a04cfb..db21d3b5 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ source ENV['GEM_SOURCE'] || 'https://rubygems.org' group :test do - gem 'voxpupuli-test', '~> 6.0', :require => false + gem 'voxpupuli-test', '~> 7.0', :require => false gem 'coveralls', :require => false gem 'simplecov-console', :require => false gem 'puppet_metadata', '~> 3.0', :require => false diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 6515b7bf..9efb4ae6 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -17,3 +17,4 @@ add_custom_fact name.to_sym, value end end +Dir['./spec/support/spec/**/*.rb'].sort.each { |f| require f } diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index d3a6e23c..2681792e 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -5,6 +5,6 @@ require 'voxpupuli/acceptance/spec_helper_acceptance' -configure_beaker +configure_beaker(modules: :metadata) Dir['./spec/support/acceptance/**/*.rb'].sort.each { |f| require f } From 40e9043d89be2a13ec1535a0524ee954dd1fb1b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Thu, 17 Aug 2023 15:16:51 -1000 Subject: [PATCH 2/2] Auto-correct rubocop offenses --- lib/puppet/provider/loginctl_user/ruby.rb | 2 +- spec/unit/facter/systemd_version_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/puppet/provider/loginctl_user/ruby.rb b/lib/puppet/provider/loginctl_user/ruby.rb index 7c5789ae..2bc3529f 100644 --- a/lib/puppet/provider/loginctl_user/ruby.rb +++ b/lib/puppet/provider/loginctl_user/ruby.rb @@ -10,7 +10,7 @@ def self.instances users = loginctl('list-users', '--no-legend').split("\n").map { |l| l.split[1] } loginctl('show-user', '-p', 'Name', '-p', 'Linger', *users).split("\n\n").map do |u| - user = u.split("\n").map { |f| f.split('=') }.to_h + user = u.split("\n").to_h { |f| f.split('=') } linger = if user['Linger'] == 'yes' 'enabled' else diff --git a/spec/unit/facter/systemd_version_spec.rb b/spec/unit/facter/systemd_version_spec.rb index ba8e028d..496bd58d 100644 --- a/spec/unit/facter/systemd_version_spec.rb +++ b/spec/unit/facter/systemd_version_spec.rb @@ -32,7 +32,7 @@ it do expect(Facter::Util::Resolution).not_to receive(:exec).with("systemctl --version | awk '/systemd/{ print $2 }'") - expect(Facter.value(:systemd_version)).to eq(nil) + expect(Facter.value(:systemd_version)).to be_nil end # rubocop:enable RSpec/StubbedMock # rubocop:enable RSpec/MessageSpies