From cd03a4d67e54b5c056e748b318df8941bc6ebe4e Mon Sep 17 00:00:00 2001 From: Sebastian Gerhards Date: Wed, 23 Mar 2016 13:03:23 +0100 Subject: [PATCH] Fix cirunner failure-message for OS families other then Debian and Redhat --- manifests/cirunner.pp | 2 +- spec/classes/cirunner_spec.rb | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/manifests/cirunner.pp b/manifests/cirunner.pp index 0c6fe9b5..7c09a2f5 100644 --- a/manifests/cirunner.pp +++ b/manifests/cirunner.pp @@ -36,7 +36,7 @@ validate_bool($manage_repo) unless ($::osfamily == 'Debian' or $::osfamily == 'RedHat') { - fail ("OS family ${::osfamily} is not supported. Only Debian is suppported.") + fail ("OS family ${::osfamily} is not supported. Only Debian and Redhat is suppported.") } if $manage_docker { diff --git a/spec/classes/cirunner_spec.rb b/spec/classes/cirunner_spec.rb index 81ae3251..49250e3d 100644 --- a/spec/classes/cirunner_spec.rb +++ b/spec/classes/cirunner_spec.rb @@ -58,5 +58,18 @@ end end + context 'unsupported operating systems' do + describe "gitlab::cirunner class without any parameters on unsupported OS" do + let(:params) {{ }} + let(:facts) {{ + :osfamily => 'unsupported_os_family', + }} + it "should fail" do + expect do + catalogue + end.to raise_error(Puppet::Error, /OS family unsupported_os_family is not supported. Only Debian and Redhat is suppported./) + end + end + end end