Skip to content

Commit

Permalink
Added unit tests for the $manage_service functionality
Browse files Browse the repository at this point in the history
I've added and amended some unit tests in order to check the
$manage_service functionality introduced in previous commits.
  • Loading branch information
queeno committed Jun 12, 2015
1 parent 8b633d9 commit 19be823
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions spec/unit/classes/smartd_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,15 @@
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

describe 'ensure => purge' do
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

Expand Down Expand Up @@ -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' }}

Expand Down

0 comments on commit 19be823

Please sign in to comment.