From d41611bf900f439712048d5e15a667430246efe5 Mon Sep 17 00:00:00 2001 From: Kenyon Ralph Date: Fri, 27 Aug 2021 13:36:08 -0700 Subject: [PATCH] os_version_gte: fix and add tests As reported in , os_version_gte is not returning correct results. This commit fixes the tests to demonstrate correct expected behavior. --- spec/functions/os_version_gte_spec.rb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/spec/functions/os_version_gte_spec.rb b/spec/functions/os_version_gte_spec.rb index 5de58384f..aec498270 100644 --- a/spec/functions/os_version_gte_spec.rb +++ b/spec/functions/os_version_gte_spec.rb @@ -11,9 +11,10 @@ } end + it { is_expected.to run.with_params('Debian', '10').and_return(false) } it { is_expected.to run.with_params('Debian', '9').and_return(true) } - it { is_expected.to run.with_params('Debian', '8').and_return(false) } - it { is_expected.to run.with_params('Debian', '8.0').and_return(false) } + it { is_expected.to run.with_params('Debian', '8').and_return(true) } + it { is_expected.to run.with_params('Debian', '8.0').and_return(true) } it { is_expected.to run.with_params('Ubuntu', '16.04').and_return(false) } it { is_expected.to run.with_params('Fedora', '29').and_return(false) } end @@ -27,9 +28,11 @@ end it { is_expected.to run.with_params('Debian', '9').and_return(false) } - it { is_expected.to run.with_params('Ubuntu', '16').and_return(false) } + it { is_expected.to run.with_params('Ubuntu', '16').and_return(true) } + it { is_expected.to run.with_params('Ubuntu', '14.04').and_return(true) } it { is_expected.to run.with_params('Ubuntu', '16.04').and_return(true) } - it { is_expected.to run.with_params('Ubuntu', '18.04').and_return(true) } + it { is_expected.to run.with_params('Ubuntu', '18.04').and_return(false) } + it { is_expected.to run.with_params('Ubuntu', '20.04').and_return(false) } it { is_expected.to run.with_params('Fedora', '29').and_return(false) } end