From fa30e3df171f77e557d7df92de3c7ecbf7c09347 Mon Sep 17 00:00:00 2001 From: Jaime Fullaondo Date: Mon, 5 Feb 2018 12:32:37 +0100 Subject: [PATCH] [apm][spec] fix APM spec tests --- spec/classes/datadog_agent_spec.rb | 33 ++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/spec/classes/datadog_agent_spec.rb b/spec/classes/datadog_agent_spec.rb index 6a18558a..f13c5a36 100644 --- a/spec/classes/datadog_agent_spec.rb +++ b/spec/classes/datadog_agent_spec.rb @@ -608,6 +608,39 @@ it { should contain_concat__fragment('datadog extra_template footer').with( 'content' => /^# extra template is here\n/, )} + it { should_not contain_concat__fragment('datadog apm footer').with( + 'order' => '07', + )} + end + context 'with APM enabled' do + let(:params) {{ + :apm_enabled => true, + :apm_env => 'foo', + }} + it { should contain_concat__fragment('datadog apm footer').with( + 'order' => '06', + )} + end + context 'with APM enabled but no APM env' do + let(:params) {{ + :apm_enabled => true, + }} + it { should_not contain_concat__fragment('datadog apm footer').with( + 'order' => '06', + )} + end + context 'with extra_template and APM enabled' do + let(:params) {{ + :extra_template => 'custom_datadog/extra_template_test.erb', + :apm_enabled => true, + :apm_env => 'foo', + }} + it { should contain_concat__fragment('datadog extra_template footer').with( + 'order' => '06', + )} + it { should contain_concat__fragment('datadog extra_template footer').with( + 'content' => /^# extra template is here\n/, + )} it { should contain_concat__fragment('datadog apm footer').with( 'order' => '07', )}