Skip to content

Commit

Permalink
Add rspec test to ensure the bracket syntax is using when available
Browse files Browse the repository at this point in the history
  • Loading branch information
txaj committed Dec 11, 2014
1 parent 5ef3917 commit 3f33f0d
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions spec/defines/collectd_plugin_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
require 'spec_helper'

describe 'collectd::plugin', :type => :define do

context 'loading a plugin on collectd <= 4.9.4' do
let(:title) { 'test' }
let :facts do
{
:collectd_version => '5.3',
:osfamily => 'Debian',
}
end

it 'Will create /etc/collectd/conf.d/10-test.conf with the LoadPlugin syntax with brackets' do
should contain_file('test.load').with_content(/<LoadPlugin/)
end
end


context 'loading a plugin on collectd => 4.9.3' do
let(:title) { 'test' }
let :facts do
{
:collectd_version => '4.9.3',
:osfamily => 'Debian',
}
end

it 'Will create /etc/collectd/conf.d/10-test.conf with the LoadPlugin syntax without brackets' do
should contain_file('test.load').without_content(/<LoadPlugin/)
end
end

end

0 comments on commit 3f33f0d

Please sign in to comment.