From c0ba3eb022c524ca671ab99b7a84a36f93f85d50 Mon Sep 17 00:00:00 2001 From: Steven Pritchard Date: Wed, 5 Jun 2024 14:48:40 -0500 Subject: [PATCH 1/8] Update gem dependencies * Update dependencies in `Gemfile` and `simp-beaker-helpers.gemspec` * Bump version * Cleanup affected files for rubocop --- .rubocop.yml | 331 +++++++++++++++-------------- CHANGELOG.md | 4 + Gemfile | 35 ++- lib/simp/beaker_helpers/version.rb | 4 +- simp-beaker-helpers.gemspec | 33 +-- 5 files changed, 206 insertions(+), 201 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index fb8f017..d20c73a 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,6 +1,7 @@ +--- require: rubocop-rspec AllCops: - TargetRubyVersion: 2.4 + TargetRubyVersion: 2.7 Include: - ./**/*.rb Exclude: @@ -14,491 +15,491 @@ AllCops: - Guardfile - Vagrantfile Layout/ConditionPosition: - Enabled: True + Enabled: true Lint/ElseLayout: - Enabled: True + Enabled: true Lint/UnreachableCode: - Enabled: True + Enabled: true Lint/BinaryOperatorWithIdenticalOperands: - Enabled: True + Enabled: true Lint/EnsureReturn: - Enabled: True + Enabled: true Lint/SuppressedException: - Enabled: True + Enabled: true Lint/LiteralAsCondition: - Enabled: True + Enabled: true Lint/ShadowingOuterLocalVariable: - Enabled: True + Enabled: true Lint/LiteralInInterpolation: - Enabled: True + Enabled: true Style/HashSyntax: - Enabled: False + Enabled: false Style/RedundantReturn: - Enabled: True + Enabled: true Layout/EndOfLine: - Enabled: False + Enabled: false Lint/AmbiguousOperator: - Enabled: True + Enabled: true Lint/AssignmentInCondition: - Enabled: True + Enabled: true Layout/SpaceBeforeComment: - Enabled: True + Enabled: true Style/AndOr: - Enabled: True + Enabled: true Style/RedundantSelf: - Enabled: True + Enabled: true Metrics/BlockLength: - Enabled: False + Enabled: false # Method length is not necessarily an indicator of code quality Metrics/MethodLength: - Enabled: False + Enabled: false # Module length is not necessarily an indicator of code quality Metrics/ModuleLength: - Enabled: False + Enabled: false Style/WhileUntilModifier: - Enabled: True + Enabled: true Lint/AmbiguousRegexpLiteral: - Enabled: True + Enabled: true Security/Eval: - Enabled: True + Enabled: true Layout/BlockAlignment: - Enabled: True + Enabled: true Layout/DefEndAlignment: - Enabled: True + Enabled: true Layout/EndAlignment: - Enabled: True + Enabled: true Lint/DeprecatedClassMethods: - Enabled: True + Enabled: true Lint/Loop: - Enabled: True + Enabled: true Lint/ParenthesesAsGroupedExpression: - Enabled: True + Enabled: true Lint/RescueException: - Enabled: True + Enabled: true Lint/RedundantStringCoercion: - Enabled: True + Enabled: true Lint/UnusedBlockArgument: - Enabled: True + Enabled: true Lint/UnusedMethodArgument: - Enabled: True + Enabled: true Lint/UselessAccessModifier: - Enabled: True + Enabled: true Lint/UselessAssignment: - Enabled: True + Enabled: true Lint/Void: - Enabled: True + Enabled: true Layout/AccessModifierIndentation: - Enabled: True + Enabled: true Naming/AccessorMethodName: - Enabled: True + Enabled: true Style/Alias: - Enabled: True + Enabled: true Layout/ArrayAlignment: - Enabled: True + Enabled: true Layout/HashAlignment: - Enabled: True + Enabled: true Layout/ParameterAlignment: - Enabled: True + Enabled: true Metrics/BlockNesting: - Enabled: True + Enabled: true Style/AsciiComments: - Enabled: True + Enabled: true Style/Attr: - Enabled: True + Enabled: true Style/CaseEquality: - Enabled: True + Enabled: true Layout/CaseIndentation: - Enabled: True + Enabled: true Style/CharacterLiteral: - Enabled: True + Enabled: true Naming/ClassAndModuleCamelCase: - Enabled: True + Enabled: true Style/ClassAndModuleChildren: - Enabled: False + Enabled: false Style/ClassCheck: - Enabled: True + Enabled: true # Class length is not necessarily an indicator of code quality Metrics/ClassLength: - Enabled: False + Enabled: false Style/ClassMethods: - Enabled: True + Enabled: true Style/ClassVars: - Enabled: True + Enabled: true Style/WhenThen: - Enabled: True + Enabled: true Style/WordArray: - Enabled: True + Enabled: true Style/RedundantPercentQ: - Enabled: True + Enabled: true Layout/IndentationStyle: - Enabled: True + Enabled: true Layout/SpaceBeforeSemicolon: - Enabled: True + Enabled: true Layout/TrailingEmptyLines: - Enabled: True + Enabled: true Layout/SpaceInsideBlockBraces: - Enabled: True + Enabled: true Layout/SpaceInsideHashLiteralBraces: - Enabled: True + Enabled: true Layout/SpaceInsideParens: - Enabled: True + Enabled: true Layout/LeadingCommentSpace: - Enabled: True + Enabled: true Layout/SpaceBeforeFirstArg: - Enabled: True + Enabled: true Layout/SpaceAfterColon: - Enabled: True + Enabled: true Layout/SpaceAfterComma: - Enabled: True + Enabled: true Layout/SpaceAfterMethodName: - Enabled: True + Enabled: true Layout/SpaceAfterNot: - Enabled: True + Enabled: true Layout/SpaceAfterSemicolon: - Enabled: True + Enabled: true Layout/SpaceAroundEqualsInParameterDefault: - Enabled: True + Enabled: true Layout/SpaceAroundOperators: - Enabled: True + Enabled: true Layout/SpaceBeforeBlockBraces: - Enabled: True + Enabled: true Layout/SpaceBeforeComma: - Enabled: True + Enabled: true Style/CollectionMethods: - Enabled: True + Enabled: true Layout/CommentIndentation: - Enabled: True + Enabled: true Style/ColonMethodCall: - Enabled: True + Enabled: true Style/CommentAnnotation: - Enabled: True + Enabled: true # 'Complexity' is very relative Metrics/CyclomaticComplexity: - Enabled: False + Enabled: false Naming/ConstantName: - Enabled: True + Enabled: true Style/Documentation: - Enabled: False + Enabled: false Style/DefWithParentheses: - Enabled: True + Enabled: true Style/PreferredHashMethods: - Enabled: True + Enabled: true Layout/DotPosition: EnforcedStyle: trailing Style/DoubleNegation: - Enabled: True + Enabled: true Style/EachWithObject: - Enabled: True + Enabled: true Layout/EmptyLineBetweenDefs: - Enabled: True + Enabled: true Layout/FirstArrayElementIndentation: - Enabled: True + Enabled: true Layout/FirstHashElementIndentation: - Enabled: True + Enabled: true Layout/IndentationConsistency: - Enabled: True + Enabled: true Layout/IndentationWidth: - Enabled: True + Enabled: true Layout/EmptyLines: - Enabled: True + Enabled: true Layout/EmptyLinesAroundAccessModifier: - Enabled: True + Enabled: true Style/EmptyLiteral: - Enabled: True + Enabled: true # Configuration parameters: AllowURI, URISchemes. Layout/TrailingWhitespace: - Enabled: True + Enabled: true Layout/LineLength: - Enabled: False + Enabled: false Naming/BinaryOperatorParameterName: - Enabled: True + Enabled: true Style/CommandLiteral: EnforcedStyle: percent_x - Enabled: True + Enabled: true Style/MethodCallWithoutArgsParentheses: - Enabled: True + Enabled: true Style/MethodDefParentheses: - Enabled: True + Enabled: true Style/LineEndConcatenation: - Enabled: True + Enabled: true Style/StringLiterals: - Enabled: True + Enabled: true Style/TrailingCommaInArguments: - Enabled: True + Enabled: true Style/TrailingCommaInArrayLiteral: - Enabled: True + Enabled: true Style/TrailingCommaInHashLiteral: - Enabled: True + Enabled: true Style/GlobalVars: - Enabled: True + Enabled: true Style/GuardClause: - Enabled: True + Enabled: true Style/IfUnlessModifier: - Enabled: True + Enabled: true Style/MultilineIfThen: - Enabled: True + Enabled: true Style/NegatedIf: - Enabled: True + Enabled: true Style/NegatedWhile: - Enabled: True + Enabled: true Style/Next: - Enabled: True + Enabled: true Style/SingleLineBlockParams: - Enabled: True + Enabled: true Style/SingleLineMethods: - Enabled: True + Enabled: true Style/SpecialGlobalVars: - Enabled: True + Enabled: true Style/TrivialAccessors: - Enabled: True + Enabled: true Style/UnlessElse: - Enabled: True + Enabled: true Style/VariableInterpolation: - Enabled: True + Enabled: true Naming/VariableName: - Enabled: True + Enabled: true Style/WhileUntilDo: - Enabled: True + Enabled: true Style/EvenOdd: - Enabled: True + Enabled: true Naming/FileName: - Enabled: True + Enabled: true Style/For: - Enabled: True + Enabled: true Style/Lambda: - Enabled: True + Enabled: true Naming/MethodName: - Enabled: True + Enabled: true Style/MultilineTernaryOperator: - Enabled: True + Enabled: true Style/NestedTernaryOperator: - Enabled: True + Enabled: true Style/NilComparison: - Enabled: True + Enabled: true Style/FormatString: - Enabled: True + Enabled: true Style/MultilineBlockChain: - Enabled: True + Enabled: true Style/Semicolon: - Enabled: True + Enabled: true Style/SignalException: - Enabled: True + Enabled: true Style/NonNilCheck: - Enabled: True + Enabled: true Style/Not: - Enabled: True + Enabled: true Style/NumericLiterals: - Enabled: True + Enabled: true Style/OneLineConditional: - Enabled: True + Enabled: true Style/ParenthesesAroundCondition: - Enabled: True + Enabled: true Style/PercentLiteralDelimiters: - Enabled: True + Enabled: true Style/PerlBackrefs: - Enabled: True + Enabled: true Naming/PredicateName: - Enabled: True + Enabled: true Style/RedundantException: - Enabled: True + Enabled: true Style/SelfAssignment: - Enabled: True + Enabled: true Style/Proc: - Enabled: True + Enabled: true Style/RaiseArgs: - Enabled: True + Enabled: true Style/RedundantBegin: - Enabled: True + Enabled: true Style/RescueModifier: - Enabled: True + Enabled: true # based on https://github.com/voxpupuli/modulesync_config/issues/168 Style/RegexpLiteral: EnforcedStyle: percent_r - Enabled: True + Enabled: true Lint/UnderscorePrefixedVariableName: - Enabled: True + Enabled: true Metrics/ParameterLists: - Enabled: False + Enabled: false Lint/RequireParentheses: - Enabled: True + Enabled: true Style/ModuleFunction: - Enabled: True + Enabled: true Lint/Debugger: - Enabled: True + Enabled: true Style/IfWithSemicolon: - Enabled: True + Enabled: true Style/Encoding: - Enabled: True + Enabled: true Style/BlockDelimiters: - Enabled: True + Enabled: true Layout/MultilineBlockLayout: - Enabled: True + Enabled: true # 'Complexity' is very relative Metrics/AbcSize: - Enabled: False + Enabled: false # 'Complexity' is very relative Metrics/PerceivedComplexity: - Enabled: False + Enabled: false Layout/ClosingParenthesisIndentation: - Enabled: True + Enabled: true # RSpec @@ -508,26 +509,26 @@ RSpec/BeforeAfterAll: # We don't use rspec in this way RSpec/DescribeClass: - Enabled: False + Enabled: false # Example length is not necessarily an indicator of code quality RSpec/ExampleLength: - Enabled: False + Enabled: false RSpec/NamedSubject: - Enabled: False + Enabled: false # disabled for now since they cause a lot of issues # these issues aren't easy to fix RSpec/RepeatedDescription: - Enabled: False + Enabled: false RSpec/NestedGroups: - Enabled: False + Enabled: false # this is broken on ruby1.9 Layout/HeredocIndentation: - Enabled: False + Enabled: false # disable Yaml safe_load. This is needed to support ruby2.0.0 development envs Security/YAMLLoad: diff --git a/CHANGELOG.md b/CHANGELOG.md index 89a53c2..c6173cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### 1.33.0 / 2024-06-05 +* Fixed: + * Update gem dependencies + ### 1.32.1 / 2023-08-28 * Fixed: * Version bump to resolve mis-tagging diff --git a/Gemfile b/Gemfile index 530ced7..79eb4c7 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,6 @@ -# ------------------------------------------------------------------------------ -# NOTE: SIMP Puppet rake tasks support ruby 2.1.9 -# ------------------------------------------------------------------------------ -gem_sources = ENV.fetch('GEM_SERVERS','https://rubygems.org').split(/[, ]+/) +# frozen_string_literal: true + +gem_sources = ENV.fetch('GEM_SERVERS', 'https://rubygems.org').split(%r{[, ]+}) gem_sources.each { |gem_source| source gem_source } @@ -13,9 +12,9 @@ gem 'bundler' gem 'rake' group :system_tests do - beaker_gem_options = ENV.fetch('BEAKER_GEM_OPTIONS', ['>= 4.28.1', '< 6.0.0']) + beaker_gem_options = ENV.fetch('BEAKER_GEM_OPTIONS', ['>= 4.28.1', '< 7.0.0']) - if "#{beaker_gem_options}".include?(':') + if beaker_gem_options.to_s.include?(':') # Just pass in BEAKER_GEM_OPTIONS as a string that would represent the usual # hash of options. # @@ -24,28 +23,26 @@ group :system_tests do # No, this isn't robust, but it's not really an 'every day' sort of thing # and safer than an `eval` begin - gem 'beaker', Hash[ - beaker_gem_options.split(',').map do |x| # Split passed options on k/v pairs - x.gsub('"', '').strip.split(/:\s|\s+=>\s+/) # Allow for either format hash keys - end.map do |k,v| - [ - k.delete(':').to_sym, # Convert all keys to symbols - v.strip - ] - end + beaker_gem_options = Hash[ + beaker_gem_options.split(','). + # Split passed options on k/v pairs + map { |x| x.gsub('"', '').strip.split(%r{:\s|\s+=>\s+}) }. # Allow for either format hash keys + map { |k, v| [k.delete(':').to_sym, v.strip] } # Convert all keys to symbols ] # Convert the whole thing to a valid Hash - rescue => e + rescue StandardError => e raise "Invalid BEAKER_GEM_OPTIONS: '#{beaker_gem_options}' => '#{e}'" end - else - gem 'beaker', beaker_gem_options end + gem 'beaker', beaker_gem_options + + gem 'bcrypt_pbkdf' gem 'beaker-rspec' gem 'beaker-windows' + gem 'ed25519' gem 'net-ssh' gem 'puppet', ENV.fetch('PUPPET_VERSION', ['>= 7.0.0', '< 9.0.0']) + gem 'puppetlabs_spec_helper', '>= 4.0.0', '< 8.0.0' gem 'rubocop' gem 'rubocop-rspec' - gem 'puppetlabs_spec_helper', '>= 4.0.0', '< 7.0.0' end diff --git a/lib/simp/beaker_helpers/version.rb b/lib/simp/beaker_helpers/version.rb index 3d45668..d8cd872 100644 --- a/lib/simp/beaker_helpers/version.rb +++ b/lib/simp/beaker_helpers/version.rb @@ -1,5 +1,7 @@ +# frozen_string_literal: true + module Simp; end module Simp::BeakerHelpers - VERSION = '1.32.1' + VERSION = '1.33.0' end diff --git a/simp-beaker-helpers.gemspec b/simp-beaker-helpers.gemspec index e477f0a..03ad128 100644 --- a/simp-beaker-helpers.gemspec +++ b/simp-beaker-helpers.gemspec @@ -1,5 +1,6 @@ -# -*- encoding: utf-8 -*- -$LOAD_PATH.unshift File.expand_path('../lib', __FILE__) +# frozen_string_literal: true + +$LOAD_PATH.unshift File.expand_path('lib', __dir__) require 'simp/beaker_helpers/version' require 'date' @@ -7,31 +8,31 @@ Gem::Specification.new do |s| s.name = 'simp-beaker-helpers' s.date = Date.today.to_s s.summary = 'beaker helper methods for SIMP' - s.description = <<-EOF + s.description = <<~END_DESCRIPTION Beaker helper methods to help scaffold SIMP acceptance tests - EOF + END_DESCRIPTION s.version = Simp::BeakerHelpers::VERSION s.license = 'Apache-2.0' - s.authors = ['Chris Tessmer','Trevor Vaughan'] + s.authors = ['Chris Tessmer', 'Trevor Vaughan'] s.email = 'simp@simp-project.org' s.homepage = 'https://github.com/simp/rubygem-simp-beaker-helpers' s.metadata = { - 'issue_tracker' => 'https://github.com/simp/rubygem-simp-beaker-helpers/issues' - } + 'issue_tracker' => 'https://github.com/simp/rubygem-simp-beaker-helpers/issues' + } - s.required_ruby_version = '>= 2.3.0' + s.required_ruby_version = '>= 2.7.0' - s.add_runtime_dependency 'beaker', ['>= 4.17.0', '< 6.0.0'] - s.add_runtime_dependency 'beaker-rspec', '~> 8.0' - s.add_runtime_dependency 'beaker-puppet', ['>= 1.18.14', '< 3.0.0'] + s.add_runtime_dependency 'beaker', ['>= 4.17.0', '< 7.0.0'] s.add_runtime_dependency 'beaker-docker', ['>= 0.8.3', '< 3.0.0'] - s.add_runtime_dependency 'docker-api', ['>= 2.1.0', '< 3.0.0'] + s.add_runtime_dependency 'beaker-puppet', ['>= 1.18.14', '< 5.0.0'] + s.add_runtime_dependency 'beaker-rspec', '~> 8.0' s.add_runtime_dependency 'beaker-vagrant', ['>= 0.6.4', '< 2.0.0'] - s.add_runtime_dependency 'highline', '~> 2.0' + s.add_runtime_dependency 'docker-api', ['>= 2.1.0', '< 3.0.0'] + s.add_runtime_dependency 'highline', ['>= 2.0', '< 4.0.0'] s.add_runtime_dependency 'nokogiri', '~> 1.8' ### s.files = Dir['Rakefile', '{bin,lib,spec}/**/*', 'README*', 'LICENSE*'] & `git ls-files -z .`.split("\0") - s.files = `git ls-files`.split("\n") - s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") - s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } + s.files = %x(git ls-files).split("\n") + s.test_files = %x(git ls-files -- {test,spec,features}/*).split("\n") + s.executables = %x(git ls-files -- bin/*).split("\n").map { |f| File.basename(f) } end From 015f0cbff56042130ac3ac403cb073c26cb1b4e3 Mon Sep 17 00:00:00 2001 From: Steven Pritchard Date: Wed, 5 Jun 2024 15:07:00 -0500 Subject: [PATCH 2/8] Drop explicit bundler gem requirement --- Gemfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Gemfile b/Gemfile index 79eb4c7..ffdc52d 100644 --- a/Gemfile +++ b/Gemfile @@ -8,7 +8,6 @@ gem_sources.each { |gem_source| source gem_source } gemspec # mandatory gems -gem 'bundler' gem 'rake' group :system_tests do From 984e2120961a3fa60541e70a38c139a94e0b0db3 Mon Sep 17 00:00:00 2001 From: Steven Pritchard Date: Wed, 5 Jun 2024 15:07:42 -0500 Subject: [PATCH 3/8] Puppet 8 tests should use Ruby 3.2 --- .github/workflows/pr_acceptance.yml | 2 +- .github/workflows/pr_tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr_acceptance.yml b/.github/workflows/pr_acceptance.yml index c984b0f..7546624 100644 --- a/.github/workflows/pr_acceptance.yml +++ b/.github/workflows/pr_acceptance.yml @@ -22,7 +22,7 @@ jobs: experimental: false - label: 'Puppet 8.x' puppet_version: '~> 8.0' - ruby_version: 3.1 + ruby_version: '3.2' experimental: true beaker: - label: beaker diff --git a/.github/workflows/pr_tests.yml b/.github/workflows/pr_tests.yml index d9ca605..a1d8c2e 100644 --- a/.github/workflows/pr_tests.yml +++ b/.github/workflows/pr_tests.yml @@ -55,7 +55,7 @@ jobs: experimental: false - label: 'Puppet 8.x' puppet_version: '~> 8.0' - ruby_version: 3.1 + ruby_version: '3.2' experimental: true env: PUPPET_VERSION: ${{matrix.puppet.puppet_version}} From 92ff368c011026fe7915c13c1580971e502f2ea4 Mon Sep 17 00:00:00 2001 From: Steven Pritchard Date: Wed, 5 Jun 2024 15:21:18 -0500 Subject: [PATCH 4/8] Drop explicit bundler install --- .github/workflows/pr_acceptance.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/pr_acceptance.yml b/.github/workflows/pr_acceptance.yml index 7546624..85b9169 100644 --- a/.github/workflows/pr_acceptance.yml +++ b/.github/workflows/pr_acceptance.yml @@ -63,10 +63,6 @@ jobs: sudo apt-get update sudo apt autoremove -y sudo systemctl start docker - - name: install bundler - run: | - gem install bundler - bundle update - name: 'run beaker:suite "${{matrix.beaker.label}}"' continue-on-error: ${{matrix.puppet.experimental || matrix.beaker.allowed_to_fail}} env: From 90e54870d448c6436632ec5929733545f3648e6c Mon Sep 17 00:00:00 2001 From: Steven Pritchard Date: Wed, 5 Jun 2024 15:25:10 -0500 Subject: [PATCH 5/8] Revert "Drop explicit bundler install" This reverts commit 92ff368c011026fe7915c13c1580971e502f2ea4. --- .github/workflows/pr_acceptance.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/pr_acceptance.yml b/.github/workflows/pr_acceptance.yml index 85b9169..7546624 100644 --- a/.github/workflows/pr_acceptance.yml +++ b/.github/workflows/pr_acceptance.yml @@ -63,6 +63,10 @@ jobs: sudo apt-get update sudo apt autoremove -y sudo systemctl start docker + - name: install bundler + run: | + gem install bundler + bundle update - name: 'run beaker:suite "${{matrix.beaker.label}}"' continue-on-error: ${{matrix.puppet.experimental || matrix.beaker.allowed_to_fail}} env: From a4b4e88bb28cda6c61f65bd0dfefc1ccdcf0438d Mon Sep 17 00:00:00 2001 From: Steven Pritchard Date: Wed, 5 Jun 2024 15:28:02 -0500 Subject: [PATCH 6/8] Drop explicit bundler install --- .github/workflows/pr_acceptance.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr_acceptance.yml b/.github/workflows/pr_acceptance.yml index 7546624..d228965 100644 --- a/.github/workflows/pr_acceptance.yml +++ b/.github/workflows/pr_acceptance.yml @@ -63,10 +63,10 @@ jobs: sudo apt-get update sudo apt autoremove -y sudo systemctl start docker - - name: install bundler + - name: install bundle run: | - gem install bundler - bundle update + bundle config path vendor + bundle install -j $(nproc) - name: 'run beaker:suite "${{matrix.beaker.label}}"' continue-on-error: ${{matrix.puppet.experimental || matrix.beaker.allowed_to_fail}} env: From 855c3c0d400b9c4d5c59c22f0160ed5755266f26 Mon Sep 17 00:00:00 2001 From: Steven Pritchard Date: Wed, 5 Jun 2024 15:45:09 -0500 Subject: [PATCH 7/8] Drop order from .rspec --- .rspec | 1 - 1 file changed, 1 deletion(-) diff --git a/.rspec b/.rspec index b5e8741..972ab07 100644 --- a/.rspec +++ b/.rspec @@ -1,4 +1,3 @@ --format documentation --fail-fast --color ---order default From 93f72399862eeebd8d2a77010c85034437d66043 Mon Sep 17 00:00:00 2001 From: Steven Pritchard Date: Thu, 6 Jun 2024 11:34:32 -0500 Subject: [PATCH 8/8] Avoid referencing undefined OpenStruct --- lib/simp/beaker_helpers.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/simp/beaker_helpers.rb b/lib/simp/beaker_helpers.rb index 816f2cc..3076361 100644 --- a/lib/simp/beaker_helpers.rb +++ b/lib/simp/beaker_helpers.rb @@ -259,7 +259,8 @@ def pfact_on(sut, fact_name) end # Ensure that Hashes return as Hash objects - found_fact.is_a?(OpenStruct) ? found_fact.marshal_dump : found_fact + # OpenStruct objects have a marshal_dump method + found_fact.respond_to?(:marshal_dump) ? found_fact.marshal_dump : found_fact end # Returns the modulepath on the SUT, as an Array