]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/rabbitmq/spec/unit/puppet/type/rabbitmq_vhost_spec.rb
move to puppetlabs rabbitmq module
[dsa-puppet.git] / 3rdparty / modules / rabbitmq / spec / unit / puppet / type / rabbitmq_vhost_spec.rb
1 require 'puppet'
2 require 'puppet/type/rabbitmq_vhost'
3 describe Puppet::Type.type(:rabbitmq_vhost) do
4   before :each do
5     @vhost = Puppet::Type.type(:rabbitmq_vhost).new(:name => 'foo')
6   end
7   it 'should accept a vhost name' do
8     @vhost[:name] = 'dan'
9     @vhost[:name].should == 'dan'
10   end
11   it 'should require a name' do
12     expect {
13       Puppet::Type.type(:rabbitmq_vhost).new({})
14     }.to raise_error(Puppet::Error, 'Title or name must be provided')
15   end
16   it 'should not allow whitespace in the name' do
17     expect {
18       @vhost[:name] = 'b r'
19     }.to raise_error(Puppet::Error, /Valid values match/)
20   end
21 end