From fe1af098b3a84f2695a67fbc2ac416b6ab5f1dc6 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Fri, 7 Feb 2020 12:49:47 +0000 Subject: [PATCH] test(packages_spec): prevent control for `bsd` family * Refactor `package_name` using `case` like other formulas --- .../integration/default/controls/packages_spec.rb | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/test/integration/default/controls/packages_spec.rb b/test/integration/default/controls/packages_spec.rb index 4b29db4..fb8efe9 100644 --- a/test/integration/default/controls/packages_spec.rb +++ b/test/integration/default/controls/packages_spec.rb @@ -1,12 +1,19 @@ # Overide by Platform -package_name = 'openssh-server' -if platform[:family] == 'suse' - package_name = 'openssh' -end +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