forked from redhat-openstack/openstack-puppet-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Tom Throckmorton
committed
Jun 19, 2015
1 parent
8c2ad77
commit 67af5f9
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
require 'spec_helper' | ||
|
||
describe 'collectd::plugin::protocols', :type => :class do | ||
let :facts do | ||
{:osfamily => 'RedHat'} | ||
end | ||
|
||
context ':ensure => present, default params' do | ||
it 'Will create /etc/collectd.d/10-protocols.conf' do | ||
should contain_file('protocols.load').with({ | ||
:ensure => 'present', | ||
:path => '/etc/collectd.d/10-protocols.conf', | ||
:content => //, | ||
}) | ||
end | ||
end | ||
|
||
context ':ensure => present, specific params' do | ||
let :params do | ||
{ :values => [ 'protocol1', 'protocol2' ], | ||
} | ||
end | ||
|
||
it 'Will create /etc/collectd.d/10-protocols.conf' do | ||
should contain_file('protocols.load').with({ | ||
:ensure => 'present', | ||
:path => '/etc/collectd.d/10-protocols.conf', | ||
:content => /<Plugin "protocols">\n\s*Value "protocol1"\n\s*Value "protocol2"\n<\/Plugin>/, | ||
}) | ||
end | ||
end | ||
|
||
context ':ensure => absent' do | ||
let :params do | ||
{:ensure => 'absent'} | ||
end | ||
|
||
it 'Will not create /etc/collectd.d/10-protocols.conf' do | ||
should contain_file('protocols.load').with({ | ||
:ensure => 'absent', | ||
:path => '/etc/collectd.d/10-protocols.conf', | ||
}) | ||
end | ||
end | ||
end | ||
|