Skip to content

Commit

Permalink
Spec fix for parameters
Browse files Browse the repository at this point in the history
- Use it_behaves_like 'an idempotent resource' in parameter_spec
- Hacky spec test fix for lack of idempotency when installing implicitly
  enabled plugins with newer RabbitMQ versions (see voxpupuli#844)
  • Loading branch information
wyardley committed May 11, 2023
1 parent 8dd67d8 commit 2358e28
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions spec/acceptance/parameter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

describe 'rabbitmq parameter on a vhost:' do
context 'create parameter resource' do
it 'runs successfully' do
pp = <<-EOS
let(:pp) do
<<-EOS
if $facts['os']['family'] == 'RedHat' {
class { 'erlang': epel_enable => true }
Class['erlang'] -> Class['rabbitmq']
Expand All @@ -17,7 +17,7 @@ class { 'rabbitmq':
admin_enable => true,
}
rabbitmq_plugin { [ 'rabbitmq_federation_management', 'rabbitmq_federation' ]:
rabbitmq_plugin { [ 'rabbitmq_federation_management' ]:
ensure => present
} ~> Service['rabbitmq-server']
Expand All @@ -33,11 +33,10 @@ class { 'rabbitmq':
},
}
EOS

apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end

it_behaves_like 'an idempotent resource'

it 'has the parameter' do
shell('rabbitmqctl list_parameters -p fedhost') do |r|
expect(r.stdout).to match(%r{federation-upstream.*documentumFed.*expires.*3600000})
Expand Down

0 comments on commit 2358e28

Please sign in to comment.