Skip to content

Commit a58b9e3

Browse files
committed
[puppet][legacy] fix spec tests for older puppets.
1 parent d80d16a commit a58b9e3

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

spec/defines/datadog_agent__integration_spec.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
}}
1616
it { should compile }
1717
it { should contain_file('/etc/dd-agent/conf.d/test.yaml').with_content(/init_config: /) }
18-
it { should contain_file('/etc/dd-agent/conf.d/test.yaml').with_content(/---\ninit_config: \ninstances:\n- one: two\n/) }
18+
gem_spec = Gem.loaded_specs['puppet']
19+
if gem_spec.version >= Gem::Version.new('4.0.0')
20+
it { should contain_file('/etc/dd-agent/conf.d/test.yaml').with_content(/---\ninit_config: \ninstances:\n- one: two\n/) }
21+
else
22+
it { should contain_file('/etc/dd-agent/conf.d/test.yaml').with_content(/--- \n init_config: \n instances:\n - one: two/) }
23+
end
1924
it { should contain_file('/etc/dd-agent/conf.d/test.yaml').that_notifies("Service[datadog-agent]") }
2025
end

0 commit comments

Comments
 (0)