From a4f2f2c532ba316d6cce2516760c710c5cb045ec Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Mon, 14 Dec 2020 09:16:39 +0000 Subject: [PATCH] test(packages_spec): refactor to check first part of version number only --- test/integration/default/controls/packages_spec.rb | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/test/integration/default/controls/packages_spec.rb b/test/integration/default/controls/packages_spec.rb index 8743ef9..8212e74 100644 --- a/test/integration/default/controls/packages_spec.rb +++ b/test/integration/default/controls/packages_spec.rb @@ -9,22 +9,16 @@ when 'amazon' case platform[:release] when '2' - '7-12' + '7' when '2018.03' - '6-8' + '6' end when 'centos' - if platform[:release].start_with?('8') - '8-8.el8' - elsif platform[:release].start_with?('7') - '7-13' - elsif platform[:release].start_with?('6') - '6-8' - end + platform[:release][0] end describe package(pkg) do it { should be_installed } - its('version') { should eq version } + its('version') { should match(/^#{version}/) } end end