2 describe Puppet::Type.type(:rabbitmq_binding) do
4 Puppet::Type.type(:rabbitmq_binding).new(
6 destination_type: :queue
10 it 'accepts an queue name' do
11 binding[:name] = 'dan@dude@pl'
12 expect(binding[:name]).to eq('dan@dude@pl')
14 it 'requires a name' do
16 Puppet::Type.type(:rabbitmq_binding).new({})
17 end.to raise_error(Puppet::Error, 'Title or name must be provided')
19 it 'errors when missing source' do
21 Puppet::Type.type(:rabbitmq_binding).new(
25 end.to raise_error(Puppet::Error, %r{`source` must be defined})
27 it 'errors when missing destination' do
29 Puppet::Type.type(:rabbitmq_binding).new(
33 end.to raise_error(Puppet::Error, %r{`destination` must be defined})
35 it 'accepts an binding destination_type' do
36 binding[:destination_type] = :exchange
37 expect(binding[:destination_type]).to eq(:exchange)
39 it 'accepts a user' do
40 binding[:user] = :root
41 expect(binding[:user]).to eq(:root)
43 it 'accepts a password' do
44 binding[:password] = :PaSsw0rD
45 expect(binding[:password]).to eq(:PaSsw0rD)