diff --git a/spec/defines/filter_spec.rb b/spec/defines/filter_spec.rb index 87e9c74..6365302 100644 --- a/spec/defines/filter_spec.rb +++ b/spec/defines/filter_spec.rb @@ -29,12 +29,7 @@ describe 'fluentd::filter' do it do is_expected.to contain_file('/etc/td-agent/conf.d/20-filter-test.conf'). - with_content(//). - with_content(/type record_transformer/). - with_content(//). - with_content(/hostname \$\{hostname\}/). - with_content(/<\/record>/). - with_content(/<\/filter>/) + with_content(IO.read(File.join(File.dirname(__FILE__), '../fixtures/files/filter_record_transformer.conf'))) end end -end \ No newline at end of file +end diff --git a/spec/defines/match_spec.rb b/spec/defines/match_spec.rb index 82a564c..c2da497 100644 --- a/spec/defines/match_spec.rb +++ b/spec/defines/match_spec.rb @@ -36,17 +36,7 @@ describe 'fluentd::match' do it do is_expected.to contain_file('/etc/td-agent/conf.d/30-match-test.conf'). - with_content(//). - with_content(/flush_interval 30s/). - with_content(/type secure_forward/). - with_content(/secure yes/). - with_content(/shared_key my_shared_key/). - with_content(/self_hostname instance.test.com/). - with_content(/ca_cert_path \/path\/to\/ca.cert/). - with_content(//). - with_content(/host test.server.com/). - with_content(/<\/server>/). - with_content(/<\/match>/) + with_content(IO.read(File.join(File.dirname(__FILE__), '../fixtures/files/match_secure_forward.conf'))) end end @@ -76,19 +66,7 @@ describe 'fluentd::match' do it do is_expected.to contain_file('/etc/td-agent/conf.d/30-match-test.conf'). - with_content(//). - with_content(/type copy/). - with_content(//). - with_content(/type elasticsearch/). - with_content(/logstashformat true/). - with_content(/hosts 172.20.10.17:9200/). - with_content(/flush_interval 30s/). - with_content(/<\/store>/). - with_content(//). - with_content(/type file/). - with_content(/path \/tmp\/td-agent-debug.log/). - with_content(/<\/store>/). - with_content(/<\/match>/) + with_content(IO.read(File.join(File.dirname(__FILE__), '../fixtures/files/match_copy.conf'))) end end end diff --git a/spec/defines/source_spec.rb b/spec/defines/source_spec.rb index 996869f..c06feda 100644 --- a/spec/defines/source_spec.rb +++ b/spec/defines/source_spec.rb @@ -28,12 +28,7 @@ describe 'fluentd::source' do it do is_expected.to contain_file('/etc/td-agent/conf.d/10-source-test.conf'). - with_content(//). - with_content(/type tail/). - with_content(/format json/). - with_content(/path \/var\/log\/test-application\/\*.json/). - with_content(/tag application.test/). - with_content(/<\/source>/) + with_content(IO.read(File.join(File.dirname(__FILE__), '../fixtures/files/source_tail.conf'))) end end -end \ No newline at end of file +end