X-Git-Url: https://git.donarmstrong.com/?p=dsa-puppet.git;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;hp=0000000000000000000000000000000000000000;hb=abf5299108b021bebf2fb9cd7519898e3baf29bd;hpb=a82772daaacb48fa7d88ef1d1216c731bdc15187 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 new file mode 100644 index 00000000..70b8e374 --- /dev/null +++ b/3rdparty/modules/rabbitmq/spec/unit/puppet/type/rabbitmq_vhost_spec.rb @@ -0,0 +1,21 @@ +require 'puppet' +require 'puppet/type/rabbitmq_vhost' +describe Puppet::Type.type(:rabbitmq_vhost) do + before :each do + @vhost = Puppet::Type.type(:rabbitmq_vhost).new(:name => 'foo') + end + it 'should accept a vhost name' do + @vhost[:name] = 'dan' + @vhost[:name].should == 'dan' + end + it 'should require a name' do + expect { + Puppet::Type.type(:rabbitmq_vhost).new({}) + }.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/) + end +end