1
0
mirror of https://github.com/krislamo/puppet-fluentd synced 2024-12-16 13:20:35 +00:00

added filter_spec

This commit is contained in:
Max Wilhelm 2015-12-04 13:11:23 +01:00
parent df6c698931
commit 87b6efde4b

View File

@ -0,0 +1,39 @@
require 'spec_helper'
describe 'fluentd::filter' do
let(:facts) {
{
:osfamily => 'Debian',
:lsbdistid => 'Ubuntu',
:operatingsystem => 'Ubuntu',
:lsbdistcodename => 'precise',
}
}
let(:pre_condition) { 'include fluentd' }
context 'basic source' do
let(:title) { 'test' }
let(:params) do
{
priority: '20',
pattern: '*.test',
config: {
'type' => 'record_transformer',
'record' => {
'hostname' => '${hostname}'
}
}
}
end
it do
is_expected.to contain_file('/etc/td-agent/conf.d/20-filter-test.conf').
with_content(/<filter \*.test>/).
with_content(/type record_transformer/).
with_content(/<record>/).
with_content(/hostname \$\{hostname\}/).
with_content(/<\/record>/).
with_content(/<\/filter>/)
end
end
end