File: rabbitmqctl_spec.rb

package info (click to toggle)
puppet-module-puppetlabs-rabbitmq 8.5.0-10
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,192 kB
  • sloc: ruby: 5,227; sh: 10; makefile: 4
file content (24 lines) | stat: -rw-r--r-- 689 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
require 'spec_helper'

provider_class = Puppet::Type.type(:rabbitmq_plugin).provider(:rabbitmqplugins)
describe provider_class do
  let(:resource) do
    Puppet::Type::Rabbitmq_plugin.new(
      name: 'foo'
    )
  end
  let(:provider) { provider_class.new(resource) }

  it 'matches plugins' do
    provider.expects(:rabbitmqplugins).with('list', '-E', '-m').returns("foo\n")
    expect(provider.exists?).to eq(true)
  end
  it 'calls rabbitmqplugins to enable' do
    provider.expects(:rabbitmqplugins).with('enable', 'foo')
    provider.create
  end
  it 'calls rabbitmqplugins to disable' do
    provider.expects(:rabbitmqplugins).with('disable', 'foo')
    provider.destroy
  end
end