From 19be823edcf1471c8c0a5a53c411ecdb10e5052b Mon Sep 17 00:00:00 2001 From: Simon Aquino Date: Fri, 12 Jun 2015 19:10:46 +0100 Subject: [PATCH] Added unit tests for the $manage_service functionality I've added and amended some unit tests in order to check the $manage_service functionality introduced in previous commits. --- spec/unit/classes/smartd_spec.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/spec/unit/classes/smartd_spec.rb b/spec/unit/classes/smartd_spec.rb index d4f76a0..d36050d 100644 --- a/spec/unit/classes/smartd_spec.rb +++ b/spec/unit/classes/smartd_spec.rb @@ -129,7 +129,7 @@ let(:params) {{ :ensure => 'absent' }} it { should contain_package('smartmontools').with_ensure('absent') } - it { should contain_service('smartd').with_ensure('stopped').with_enable(false) } + it { should_not contain_service('smartd') } it { should contain_file('/etc/smartd.conf').with_ensure('absent') } end @@ -137,7 +137,7 @@ let(:params) {{ :ensure => 'purged' }} it { should contain_package('smartmontools').with_ensure('purged') } - it { should contain_service('smartd').with_ensure('stopped').with_enable(false) } + it { should_not contain_service('smartd') } it { should contain_file('/etc/smartd.conf').with_ensure('absent') } end @@ -165,6 +165,12 @@ it { should contain_service('smartd').with_ensure('stopped').with_enable(false) } end + describe 'manage_service => false' do + let(:params) {{ :manage_service => false }} + + it { should_not contain_service('smartd') } + end + describe 'service_ensure => badvalue' do let(:params) {{ :service_ensure => 'badvalue' }}