3 provider_class = Puppet::Type.type(:rabbitmq_vhost).provider(:rabbitmqctl)
4 describe provider_class do
6 Puppet::Type::Rabbitmq_vhost.new(
10 let(:provider) { provider_class.new(resource) }
12 it 'matches vhost names' do
13 provider.expects(:rabbitmqctl).with('-q', 'list_vhosts').returns <<-EOT
18 expect(provider.exists?).to eq(true)
20 it 'does not match if no vhosts on system' do
21 provider.expects(:rabbitmqctl).with('-q', 'list_vhosts').returns <<-EOT
25 expect(provider.exists?).to eq(false)
27 it 'does not match if no matching vhosts on system' do
28 provider.expects(:rabbitmqctl).with('-q', 'list_vhosts').returns <<-EOT
33 expect(provider.exists?).to eq(false)
35 it 'calls rabbitmqctl to create' do
36 provider.expects(:rabbitmqctl).with('add_vhost', 'foo')
39 it 'calls rabbitmqctl to create' do
40 provider.expects(:rabbitmqctl).with('delete_vhost', 'foo')