Skip to content

Commit

Permalink
Fix test setup based on os.family
Browse files Browse the repository at this point in the history
Due to usage of a symbol instead of a String, we always ended in the
`else` case because `os[:family]` is nil.

There is also a mix of os.name and os.family, and string comparison is
case sensitive in Ruby, so rework the code to do the expected thing.
  • Loading branch information
smortex committed Apr 12, 2024
1 parent fd206d2 commit 66b0e7d
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions spec/spec_helper_acceptance_local.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,14 @@ def create_repo

# Configure all nodes in nodeset
c.before :suite do
case os[:family]
when 'redhat'
case os['family']
when 'Debian', 'RedHat', 'Suse'
LitmusHelper.instance.apply_manifest("package { 'epel-release': ensure => present, }") if os[:name] != 'Fedora'
pp = <<-PP
package { 'git': ensure => present, }
package { 'subversion': ensure => present, }
PP
LitmusHelper.instance.apply_manifest(pp)
when %r{(ubuntu|[dD]ebian|sles)}
pp = <<-PP
package { 'git-core': ensure => present, }
package { 'subversion': ensure => present, }
PP
LitmusHelper.instance.apply_manifest(pp)
else
unless LitmusHelper.instance.run_bolt_task('package', 'action' => 'status', 'name' => 'git')
puts 'Git package is required for this module'
Expand Down

0 comments on commit 66b0e7d

Please sign in to comment.