From d920244e2f1ec90d84f394af54167bfd31cd20fc Mon Sep 17 00:00:00 2001 From: Tim Date: Sun, 31 Oct 2021 18:25:49 +0100 Subject: [PATCH 1/2] modulesync 5.0.0 --- .msync.yml | 2 +- Gemfile | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.msync.yml b/.msync.yml index 43966c2..e1cd81c 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: '4.2.0' +modulesync_config_version: '5.0.0' diff --git a/Gemfile b/Gemfile index e43173e..2b731b9 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ source ENV['GEM_SOURCE'] || "https://rubygems.org" group :test do - gem 'voxpupuli-test', '~> 2.5', :require => false + gem 'voxpupuli-test', '~> 4.0', :require => false gem 'coveralls', :require => false gem 'simplecov-console', :require => false gem 'puppet_metadata', '~> 1.0', :require => false @@ -22,7 +22,7 @@ end group :release do gem 'github_changelog_generator', '>= 1.16.1', :require => false if RUBY_VERSION >= '2.5' - gem 'voxpupuli-release', '>= 1.0.2', :require => false + gem 'voxpupuli-release', '>= 1.2.0', :require => false gem 'puppet-strings', '>= 2.2', :require => false end From 41decd6cee372c7d28af8f80a5392f8f05e55ceb Mon Sep 17 00:00:00 2001 From: Tim Date: Sun, 31 Oct 2021 19:04:38 +0100 Subject: [PATCH 2/2] rubocop: autofix --- spec/acceptance/standard_spec.rb | 2 ++ spec/classes/repo_spec.rb | 9 +++++++-- spec/spec_helper.rb | 10 +++++----- spec/spec_helper_acceptance.rb | 2 ++ 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/spec/acceptance/standard_spec.rb b/spec/acceptance/standard_spec.rb index 7d723bc..c2f5690 100644 --- a/spec/acceptance/standard_spec.rb +++ b/spec/acceptance/standard_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper_acceptance' describe 'hashi_stack::repo class' do diff --git a/spec/classes/repo_spec.rb b/spec/classes/repo_spec.rb index c94a49f..8646a4a 100644 --- a/spec/classes/repo_spec.rb +++ b/spec/classes/repo_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe 'hashi_stack::repo' do @@ -5,15 +7,18 @@ describe 'hashi_stack::repo' do context "on #{os}" do let(:facts) { os_facts } + it { is_expected.to compile.with_all_deps } + case os_facts[:os]['family'] when 'Debian' it { is_expected.to contain_apt__source('HashiCorp') } when 'RedHat' it { - is_expected.to contain_yumrepo('HashiCorp').with( + expect(subject).to contain_yumrepo('HashiCorp').with( baseurl: 'https://rpm.releases.hashicorp.com/RHEL/$releasever/$basearch/stable' ) } + context 'with custom Yum base url' do let(:params) do { @@ -22,7 +27,7 @@ describe 'hashi_stack::repo' do end it { - is_expected.to contain_yumrepo('HashiCorp').with( + expect(subject).to contain_yumrepo('HashiCorp').with( baseurl: 'https://somewhere.else/RHEL/$releasever/$basearch/stable' ) } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index fb5f0cb..4d617f3 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,17 +1,17 @@ +# frozen_string_literal: true + # Managed by modulesync - DO NOT EDIT # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ # puppetlabs_spec_helper will set up coverage if the env variable is set. # We want to do this if lib exists and it hasn't been explicitly set. -ENV['COVERAGE'] ||= 'yes' if Dir.exist?(File.expand_path('../../lib', __FILE__)) +ENV['COVERAGE'] ||= 'yes' if Dir.exist?(File.expand_path('../lib', __dir__)) require 'voxpupuli/test/spec_helper' if File.exist?(File.join(__dir__, 'default_module_facts.yml')) facts = YAML.safe_load(File.read(File.join(__dir__, 'default_module_facts.yml'))) - if facts - facts.each do |name, value| - add_custom_fact name.to_sym, value - end + facts&.each do |name, value| + add_custom_fact name.to_sym, value end end diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index bec34fd..f3021fa 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This file is completely managed via modulesync require 'voxpupuli/acceptance/spec_helper_acceptance'