From 2a781a0b47b722d6c8835bd716f14f2f7b44d77c Mon Sep 17 00:00:00 2001 From: codec Date: Thu, 20 Feb 2014 16:18:11 +0100 Subject: [PATCH 1/2] add osfamily debian to params --- manifests/params.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/manifests/params.pp b/manifests/params.pp index dd5a056..e7658b4 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -8,6 +8,7 @@ case $::osfamily { 'redhat': {} + 'debian': {} default: { fail("Module ${module_name} is not supported on ${::operatingsystem}") } From 92f8e41b94fdd248d94d84be0e7601f0ce73a4a5 Mon Sep 17 00:00:00 2001 From: codec Date: Thu, 6 Mar 2014 21:14:38 +0100 Subject: [PATCH 2/2] update spec to fail on OpenSuSE / incl. Debian --- spec/classes/params_spec.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/spec/classes/params_spec.rb b/spec/classes/params_spec.rb index 4108250..2c092c5 100644 --- a/spec/classes/params_spec.rb +++ b/spec/classes/params_spec.rb @@ -7,17 +7,23 @@ it { should include_class('udev::params') } end + describe 'for osfamily Debian' do + let(:facts) {{ :osfamily => 'Debian' }} + + it { should include_class('udev::params') } + end + describe 'unsupported osfamily' do let :facts do { - :osfamily => 'Debian', - :operatingsystem => 'Debian', + :osfamily => 'Suse', + :operatingsystem => 'OpenSuSE', } end it 'should fail' do expect { should include_class('udev::params') }. - to raise_error(Puppet::Error, /not supported on Debian/) + to raise_error(Puppet::Error, /not supported on OpenSuSE/) end end