X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Frabbitmq%2Fspec%2Funit%2Fpuppet%2Fprovider%2Frabbitmq_plugin%2Frabbitmqctl_spec.rb;fp=3rdparty%2Fmodules%2Frabbitmq%2Fspec%2Funit%2Fpuppet%2Fprovider%2Frabbitmq_plugin%2Frabbitmqctl_spec.rb;h=3c0a757b1c73c2fc9ac92dff2d327742bf15bbf9;hb=921e69100a563cf143f56a3905d8362336d939ff;hp=c398b62929520e187917f12a030f100242a388f9;hpb=b54f52d2899c5785923c804fdfbba0782c147da4;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/rabbitmq/spec/unit/puppet/provider/rabbitmq_plugin/rabbitmqctl_spec.rb b/3rdparty/modules/rabbitmq/spec/unit/puppet/provider/rabbitmq_plugin/rabbitmqctl_spec.rb index c398b6292..3c0a757b1 100644 --- a/3rdparty/modules/rabbitmq/spec/unit/puppet/provider/rabbitmq_plugin/rabbitmqctl_spec.rb +++ b/3rdparty/modules/rabbitmq/spec/unit/puppet/provider/rabbitmq_plugin/rabbitmqctl_spec.rb @@ -1,26 +1,24 @@ -require 'puppet' -require 'mocha' -RSpec.configure do |config| - config.mock_with :mocha -end +require 'spec_helper' + provider_class = Puppet::Type.type(:rabbitmq_plugin).provider(:rabbitmqplugins) describe provider_class do - before :each do - @resource = Puppet::Type::Rabbitmq_plugin.new( - {:name => 'foo'} + let(:resource) do + Puppet::Type::Rabbitmq_plugin.new( + name: 'foo' ) - @provider = provider_class.new(@resource) end - it 'should match plugins' do - @provider.expects(:rabbitmqplugins).with('list', '-E', '-m').returns("foo\n") - @provider.exists?.should == 'foo' + 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 'should call rabbitmqplugins to enable' do - @provider.expects(:rabbitmqplugins).with('enable', 'foo') - @provider.create + it 'calls rabbitmqplugins to enable' do + provider.expects(:rabbitmqplugins).with('enable', 'foo') + provider.create end - it 'should call rabbitmqplugins to disable' do - @provider.expects(:rabbitmqplugins).with('disable', 'foo') - @provider.destroy + it 'calls rabbitmqplugins to disable' do + provider.expects(:rabbitmqplugins).with('disable', 'foo') + provider.destroy end end