- rabbitmq_queue { 'queue1@host1':
- user => 'dan',
- password => 'bar',
- durable => true,
- auto_delete => false,
- ensure => present,
- } ->
-
- rabbitmq_binding { 'binding 1':
- source => 'exchange1',
- destination => 'queue1',
- user => 'dan',
- vhost => 'host1',
- password => 'bar',
- destination_type => 'queue',
- routing_key => 'test1',
- ensure => present,
- } ->
-
- rabbitmq_binding { 'binding 2':
- source => 'exchange1',
- destination => 'queue1',
- user => 'dan',
- vhost => 'host1',
- password => 'bar',
- destination_type => 'queue',
- routing_key => 'test2',
- ensure => present,
- }
-
- EOS
-
- apply_manifest(pp, catch_failures: true)
- apply_manifest(pp, catch_changes: true)
- end
-
- # rubocop:disable RSpec/MultipleExpectations
- it 'has the bindings' do
- shell('rabbitmqctl list_bindings -q -p host1') do |r|
- expect(r.stdout).to match(%r{exchange1\sexchange\squeue1\squeue\stest1})
- expect(r.stdout).to match(%r{exchange1\sexchange\squeue1\squeue\stest2})
- expect(r.exit_code).to be_zero
- end
- end
- # rubocop:enable RSpec/MultipleExpectations
-
- it 'puppet resource shows a binding' do
- shell('puppet resource rabbitmq_binding') do |r|
- expect(r.stdout).to match(%r{source\s+=>\s+'exchange1',})
- end
- end