1
0
mirror of https://github.com/krislamo/puppet-fluentd synced 2024-12-16 05:10:36 +00:00

use rspec-puppet-facts for source_spec

This commit is contained in:
Max Wilhelm 2017-08-17 13:34:13 +02:00
parent 613a28ccaf
commit fc0f3fdf88

View File

@ -1,34 +1,33 @@
require 'spec_helper' require 'spec_helper'
describe 'fluentd::source' do describe 'fluentd::source' do
let(:facts) { on_supported_os.each do |os, facts|
{ context "on #{os}" do
:osfamily => 'Debian', let :facts do
:lsbdistid => 'Ubuntu', facts
:operatingsystem => 'Ubuntu', end
:lsbdistcodename => 'precise',
:architecture => 'amd64',
}
}
let(:pre_condition) { 'include fluentd' }
context 'basic source' do let(:pre_condition) { 'include fluentd' }
let(:title) { 'test' }
let(:params) do describe 'basic source' do
{ let(:title) { 'test' }
priority: '10', let(:params) do
config: { {
'type' => 'tail', priority: '10',
'format' => 'json', config: {
'path' => '/var/log/test-application/*.json', 'type' => 'tail',
'tag' => 'application.test' 'format' => 'json',
'path' => '/var/log/test-application/*.json',
'tag' => 'application.test'
}
} }
} end
end
it do it do
is_expected.to contain_file('/etc/td-agent/conf.d/10-source-test.conf'). is_expected.to contain_file('/etc/td-agent/conf.d/10-source-test.conf').
with_content(IO.read(File.join(File.dirname(__FILE__), '../fixtures/files/source_tail.conf'))) with_content(IO.read(File.join(File.dirname(__FILE__), '../fixtures/files/source_tail.conf')))
end
end
end end
end end
end end