Skip to content

Commit ae093a1

Browse files
author
Alvin Huang
committed
fixing tests with new rabbitmq params
1 parent fbb8dff commit ae093a1

1 file changed

Lines changed: 20 additions & 5 deletions

File tree

spec/classes/datadog_agent_integrations_rabbitmq_spec.rb

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,40 @@
2121
it { should contain_file(conf_file).that_notifies("Service[#{dd_service}]") }
2222

2323
context 'with default parameters' do
24-
it { should contain_file(conf_file).with_content(%r{rabbitmq_api_url: }) }
25-
it { should contain_file(conf_file).without_content(%r{rabbitmq_user: }) }
26-
it { should contain_file(conf_file).without_content(%r{rabbitmq_pass: }) }
27-
it { should contain_file(conf_file).without_content(%r{queues: }) }
28-
it { should contain_file(conf_file).without_content(%r{vhosts: }) }
24+
it { should contain_file(conf_file).with_content(%r{rabbitmq_api_url:}) }
25+
it { should contain_file(conf_file).with_content(%r{rabbitmq_user: guest}) }
26+
it { should contain_file(conf_file).with_content(%r{rabbitmq_pass: guest}) }
27+
it { should contain_file(conf_file).with_content(%r{ssl_verify: true}) }
28+
it { should contain_file(conf_file).with_content(%r{tag_families: false}) }
29+
it { should contain_file(conf_file).without_content(%r{nodes:}) }
30+
it { should contain_file(conf_file).without_content(%r{nodes_regexes:}) }
31+
it { should contain_file(conf_file).without_content(%r{queues:}) }
32+
it { should contain_file(conf_file).without_content(%r{queues_regexes:}) }
33+
it { should contain_file(conf_file).without_content(%r{vhosts:}) }
2934
end
3035

3136
context 'with parameters set' do
3237
let(:params) {{
3338
url: 'http://rabbit1:15672/',
3439
username: 'foo',
3540
password: 'bar',
41+
ssl_verify: false,
42+
tag_families: true,
43+
nodes: %w{ node1 node2 node3 },
44+
nodes_regexes: %w{ ^regex1 regex2$ regex3* },
3645
queues: %w{ queue1 queue2 queue3 },
46+
queues_regexes: %w{ ^regex4 regex5$ regex6* },
3747
vhosts: %w{ vhost1 vhost2 vhost3 },
3848
}}
3949
it { should contain_file(conf_file).with_content(%r{rabbitmq_api_url: http://rabbit1:15672/}) }
4050
it { should contain_file(conf_file).with_content(%r{rabbitmq_user: foo}) }
4151
it { should contain_file(conf_file).with_content(%r{rabbitmq_pass: bar}) }
52+
it { should contain_file(conf_file).with_content(%r{ssl_verify: false}) }
53+
it { should contain_file(conf_file).with_content(%r{tag_families: true}) }
54+
it { should contain_file(conf_file).with_content(%r{nodes:\s+- node1\s+- node2\s+- node3}) }
55+
it { should contain_file(conf_file).with_content(%r{nodes_regexes:\s+- \^regex1\s+- regex2\$\s+- regex3\*}) }
4256
it { should contain_file(conf_file).with_content(%r{queues:\s+- queue1\s+- queue2\s+- queue3}) }
57+
it { should contain_file(conf_file).with_content(%r{queues_regexes:\s+- \^regex4\s+- regex5\$\s+- regex6\*}) }
4358
it { should contain_file(conf_file).with_content(%r{vhosts:\s+- vhost1\s+- vhost2\s+- vhost3}) }
4459
end
4560
end

0 commit comments

Comments
 (0)