Skip to content

Commit

Permalink
improving the memory spec
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Heerschap committed Jul 25, 2015
1 parent 6de1b80 commit 9ca5d94
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion spec/classes/collectd_plugin_memory_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,27 @@
should contain_file('memory.load').with({
:ensure => 'present',
:path => '/etc/collectd.d/10-memory.conf',
:content => /\#\ Generated by Puppet\n<LoadPlugin memory>\n Globals false\n<\/LoadPlugin>\n/,
:content => /LoadPlugin memory/,
})
end
end

context ':ensure => present' do
context ':ensure => present and collectd version < 5.5' do

it 'Will create /etc/collectd.d/10-memory.conf to load the plugin' do
should contain_file('cpu.load').with({
:ensure => 'present',
:path => '/etc/collectd.d/10-memory.conf',
:content => /LoadPlugin memory/,
})
end

it 'Will not include ValuesPercentage in /etc/collectd.d/10-memory.conf' do
should_not contain_file('cpu.load').with_content(/ValuesPercentage/)
end
end

context ':ensure => present, specific params, collectd version 5.5.0' do
let :facts do
{ :osfamily => 'Redhat',
Expand Down

0 comments on commit 9ca5d94

Please sign in to comment.