test(packages_spec): prevent control for bsd family

* Refactor `package_name` using `case` like other formulas
This commit is contained in:
Imran Iqbal 2020-02-07 12:49:47 +00:00
parent 7257adefee
commit fe1af098b3
No known key found for this signature in database
GPG Key ID: 6D8629439D2B7819

View File

@ -1,12 +1,19 @@
# Overide by Platform
package_name = 'openssh-server'
if platform[:family] == 'suse'
package_name = 'openssh'
package_name =
case platform[:family]
when 'suse'
'openssh'
else
'openssh-server'
end
control 'openssh package' do
title 'should be installed'
only_if do
platform.family != 'bsd'
end
describe package(package_name) do
it { should be_installed }
end