From 3f33f0deb11fb88d6813a11e82922423d822d6fb Mon Sep 17 00:00:00 2001 From: txaj Date: Wed, 10 Dec 2014 23:21:24 -0700 Subject: [PATCH] Add rspec test to ensure the bracket syntax is using when available --- spec/defines/collectd_plugin_spec.rb | 34 ++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 spec/defines/collectd_plugin_spec.rb diff --git a/spec/defines/collectd_plugin_spec.rb b/spec/defines/collectd_plugin_spec.rb new file mode 100644 index 000000000..b2e59c0a5 --- /dev/null +++ b/spec/defines/collectd_plugin_spec.rb @@ -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(/ 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(/