Skip to content

Commit 66b0e7d

Browse files
committed
Fix test setup based on os.family
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.
1 parent fd206d2 commit 66b0e7d

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

spec/spec_helper_acceptance_local.rb

+2-8
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,14 @@ def create_repo
2828

2929
# Configure all nodes in nodeset
3030
c.before :suite do
31-
case os[:family]
32-
when 'redhat'
31+
case os['family']
32+
when 'Debian', 'RedHat', 'Suse'
3333
LitmusHelper.instance.apply_manifest("package { 'epel-release': ensure => present, }") if os[:name] != 'Fedora'
3434
pp = <<-PP
3535
package { 'git': ensure => present, }
3636
package { 'subversion': ensure => present, }
3737
PP
3838
LitmusHelper.instance.apply_manifest(pp)
39-
when %r{(ubuntu|[dD]ebian|sles)}
40-
pp = <<-PP
41-
package { 'git-core': ensure => present, }
42-
package { 'subversion': ensure => present, }
43-
PP
44-
LitmusHelper.instance.apply_manifest(pp)
4539
else
4640
unless LitmusHelper.instance.run_bolt_task('package', 'action' => 'status', 'name' => 'git')
4741
puts 'Git package is required for this module'

0 commit comments

Comments
 (0)