X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Frabbitmq%2Fspec%2Funit%2Fpuppet%2Ftype%2Frabbitmq_vhost_spec.rb;fp=3rdparty%2Fmodules%2Frabbitmq%2Fspec%2Funit%2Fpuppet%2Ftype%2Frabbitmq_vhost_spec.rb;h=70b8e374149c9fbab3f36f3f14d6a4bb167a39a9;hb=24caa46729f80fbba4be8b9b26ebcb3acc4cb0fb;hp=38337b17abfd1263af5e728920c26b0e8e4956ca;hpb=c7e7bcc28cc5dc48a7e284a3c82f33df27d1f57d;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 38337b17a..70b8e3741 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 'spec_helper' +require 'puppet' +require 'puppet/type/rabbitmq_vhost' describe Puppet::Type.type(:rabbitmq_vhost) do - let(:vhost) do - Puppet::Type.type(:rabbitmq_vhost).new(name: 'foo') + before :each do + @vhost = Puppet::Type.type(:rabbitmq_vhost).new(:name => 'foo') end - - it 'accepts a vhost name' do - vhost[:name] = 'dan' - expect(vhost[:name]).to eq('dan') + it 'should accept a vhost name' do + @vhost[:name] = 'dan' + @vhost[:name].should == 'dan' end - it 'requires a name' do - expect do + it 'should require a name' do + expect { Puppet::Type.type(:rabbitmq_vhost).new({}) - end.to raise_error(Puppet::Error, 'Title or name must be provided') + }.to raise_error(Puppet::Error, 'Title or name must be provided') end - 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}) + it 'should not allow whitespace in the name' do + expect { + @vhost[:name] = 'b r' + }.to raise_error(Puppet::Error, /Valid values match/) end end