X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;ds=sidebyside;f=3rdparty%2Fmodules%2Frabbitmq%2Fspec%2Funit%2Fpuppet%2Ftype%2Frabbitmq_vhost_spec.rb;h=38337b17abfd1263af5e728920c26b0e8e4956ca;hb=94a8783f522bbf2996cb8a59b977dea583e8b0c7;hp=70b8e374149c9fbab3f36f3f14d6a4bb167a39a9;hpb=abf5299108b021bebf2fb9cd7519898e3baf29bd;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/rabbitmq/spec/unit/puppet/type/rabbitmq_vhost_spec.rb b/3rdparty/modules/rabbitmq/spec/unit/puppet/type/rabbitmq_vhost_spec.rb index 70b8e3741..38337b17a 100644 --- a/3rdparty/modules/rabbitmq/spec/unit/puppet/type/rabbitmq_vhost_spec.rb +++ b/3rdparty/modules/rabbitmq/spec/unit/puppet/type/rabbitmq_vhost_spec.rb @@ -1,21 +1,21 @@ -require 'puppet' -require 'puppet/type/rabbitmq_vhost' +require 'spec_helper' describe Puppet::Type.type(:rabbitmq_vhost) do - before :each do - @vhost = Puppet::Type.type(:rabbitmq_vhost).new(:name => 'foo') + let(:vhost) do + Puppet::Type.type(:rabbitmq_vhost).new(name: 'foo') end - it 'should accept a vhost name' do - @vhost[:name] = 'dan' - @vhost[:name].should == 'dan' + + it 'accepts a vhost name' do + vhost[:name] = 'dan' + expect(vhost[:name]).to eq('dan') end - it 'should require a name' do - expect { + it 'requires a name' do + expect do Puppet::Type.type(:rabbitmq_vhost).new({}) - }.to raise_error(Puppet::Error, 'Title or name must be provided') + end.to raise_error(Puppet::Error, 'Title or name must be provided') end - it 'should not allow whitespace in the name' do - expect { - @vhost[:name] = 'b r' - }.to raise_error(Puppet::Error, /Valid values match/) + it 'does not allow whitespace in the name' do + expect do + vhost[:name] = 'b r' + end.to raise_error(Puppet::Error, %r{Valid values match}) end end