X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Fspec%2Ffunctions%2Fos_version_gte_spec.rb;fp=3rdparty%2Fmodules%2Fstdlib%2Fspec%2Ffunctions%2Fos_version_gte_spec.rb;h=4abfd7ef37d049aeb4d8d9bee70dea34d2c1d278;hb=9dd86576df2182653f8e96f51f11c917341eb4ce;hp=0000000000000000000000000000000000000000;hpb=88887aa2a8ca345d6f79fccb336a9bb9ae8443a2;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/stdlib/spec/functions/os_version_gte_spec.rb b/3rdparty/modules/stdlib/spec/functions/os_version_gte_spec.rb new file mode 100644 index 000000000..4abfd7ef3 --- /dev/null +++ b/3rdparty/modules/stdlib/spec/functions/os_version_gte_spec.rb @@ -0,0 +1,33 @@ +require 'spec_helper' + +describe 'os_version_gte' do + context 'on Debian 9' do + let(:facts) do + { + :operatingsystem => 'Debian', + :operatingsystemmajrelease => '9', + } + end + + 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('Ubuntu', '16.04').and_return(false) } + it { is_expected.to run.with_params('Fedora', '29').and_return(false) } + end + + context 'on Ubuntu 16.04' do + let(:facts) do + { + :operatingsystem => 'Ubuntu', + :operatingsystemmajrelease => '16.04', + } + 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.04').and_return(true) } + it { is_expected.to run.with_params('Ubuntu', '18.04').and_return(true) } + it { is_expected.to run.with_params('Fedora', '29').and_return(false) } + end +end