fc3722ae4b37df9cd6a69fdf07bcbf376854d345
[mirror/dsa-puppet.git] / 3rdparty / modules / rabbitmq / spec / acceptance / vhost_spec.rb
1 require 'spec_helper_acceptance'
2
3 describe 'rabbitmq vhost:' do
4   context 'create vhost resource' do
5     it 'runs successfully' do
6       pp = <<-EOS
7       if $facts['os']['family'] == 'RedHat' {
8         class { 'erlang': epel_enable => true }
9         Class['erlang'] -> Class['rabbitmq']
10       }
11       class { 'rabbitmq':
12         service_manage    => true,
13         port              => 5672,
14         delete_guest_user => true,
15         admin_enable      => true,
16       } ->
17
18       rabbitmq_vhost { 'myhost':
19         ensure => present,
20       }
21       EOS
22
23       apply_manifest(pp, catch_failures: true)
24       apply_manifest(pp, catch_changes: true)
25     end
26
27     # rubocop:disable RSpec/MultipleExpectations
28     it 'has the vhost' do
29       shell('rabbitmqctl list_vhosts') do |r|
30         expect(r.stdout).to match(%r{myhost})
31         expect(r.exit_code).to be_zero
32       end
33     end
34     # rubocop:enable RSpec/MultipleExpectations
35   end
36 end