Update rabbitmq module
[mirror/dsa-puppet.git] / 3rdparty / modules / rabbitmq / spec / unit / puppet / provider / rabbitmq_plugin / rabbitmqctl_spec.rb
1 require 'spec_helper'
2
3 provider_class = Puppet::Type.type(:rabbitmq_plugin).provider(:rabbitmqplugins)
4 describe provider_class do
5   let(:resource) do
6     Puppet::Type::Rabbitmq_plugin.new(
7       name: 'foo'
8     )
9   end
10   let(:provider) { provider_class.new(resource) }
11
12   it 'matches plugins' do
13     provider.expects(:rabbitmqplugins).with('list', '-E', '-m').returns("foo\n")
14     expect(provider.exists?).to eq(true)
15   end
16   it 'calls rabbitmqplugins to enable' do
17     provider.expects(:rabbitmqplugins).with('enable', 'foo')
18     provider.create
19   end
20   it 'calls rabbitmqplugins to disable' do
21     provider.expects(:rabbitmqplugins).with('disable', 'foo')
22     provider.destroy
23   end
24 end