X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Frabbitmq%2Fspec%2Facceptance%2Frabbitmqadmin_spec.rb;h=149e42374ffa34dc36be23662cb3b55daf94f93b;hb=94a8783f522bbf2996cb8a59b977dea583e8b0c7;hp=e9d619cd44306bb4cc09581e47346b69504c2a5f;hpb=e107504bce7d9b21cc301124fc7c39fdb0762374;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/rabbitmq/spec/acceptance/rabbitmqadmin_spec.rb b/3rdparty/modules/rabbitmq/spec/acceptance/rabbitmqadmin_spec.rb index e9d619cd4..149e42374 100644 --- a/3rdparty/modules/rabbitmq/spec/acceptance/rabbitmqadmin_spec.rb +++ b/3rdparty/modules/rabbitmq/spec/acceptance/rabbitmqadmin_spec.rb @@ -1,51 +1,51 @@ require 'spec_helper_acceptance' describe 'rabbitmq::install::rabbitmqadmin class' do - context 'does nothing if service is unmanaged' do - it 'should run successfully' do + context 'downloads the cli tools' do + it 'runs successfully' do pp = <<-EOS class { 'rabbitmq': admin_enable => true, - service_manage => false, + service_manage => true, } - if $::osfamily == 'RedHat' { + if $facts['os']['family'] == 'RedHat' { class { 'erlang': epel_enable => true} Class['erlang'] -> Class['rabbitmq'] } EOS - shell('rm -f /var/lib/rabbitmq/rabbitmqadmin') - apply_manifest(pp, :catch_failures => true) + apply_manifest(pp, catch_failures: true) end describe file('/var/lib/rabbitmq/rabbitmqadmin') do - it { should_not be_file } + it { is_expected.to be_file } end end - context 'downloads the cli tools' do - it 'should run successfully' do + context 'does nothing if service is unmanaged' do + it 'runs successfully' do pp = <<-EOS class { 'rabbitmq': admin_enable => true, - service_manage => true, + service_manage => false, } - if $::osfamily == 'RedHat' { + if $facts['os']['family'] == 'RedHat' { class { 'erlang': epel_enable => true} Class['erlang'] -> Class['rabbitmq'] } EOS - apply_manifest(pp, :catch_failures => true) + shell('rm -f /var/lib/rabbitmq/rabbitmqadmin') + apply_manifest(pp, catch_failures: true) end describe file('/var/lib/rabbitmq/rabbitmqadmin') do - it { should be_file } + it { is_expected.not_to be_file } end end context 'works with specified default credentials' do - it 'should run successfully' do + it 'runs successfully' do # make sure credential change takes effect before admin_enable pp_pre = <<-EOS class { 'rabbitmq': @@ -53,7 +53,7 @@ describe 'rabbitmq::install::rabbitmqadmin class' do default_user => 'foobar', default_pass => 'bazblam', } - if $::osfamily == 'RedHat' { + if $facts['os']['family'] == 'RedHat' { class { 'erlang': epel_enable => true} Class['erlang'] -> Class['rabbitmq'] } @@ -66,20 +66,19 @@ describe 'rabbitmq::install::rabbitmqadmin class' do default_user => 'foobar', default_pass => 'bazblam', } - if $::osfamily == 'RedHat' { + if $facts['os']['family'] == 'RedHat' { class { 'erlang': epel_enable => true} Class['erlang'] -> Class['rabbitmq'] } EOS shell('rm -f /var/lib/rabbitmq/rabbitmqadmin') - apply_manifest(pp_pre, :catch_failures => true) - apply_manifest(pp, :catch_failures => true) + apply_manifest(pp_pre, catch_failures: true) + apply_manifest(pp, catch_failures: true) end describe file('/var/lib/rabbitmq/rabbitmqadmin') do - it { should be_file } + it { is_expected.to be_file } end end - end