diff --git a/spec/acceptance/policy_spec.rb b/spec/acceptance/policy_spec.rb index 76f395d35..26858ecc5 100644 --- a/spec/acceptance/policy_spec.rb +++ b/spec/acceptance/policy_spec.rb @@ -33,13 +33,14 @@ class { '::rabbitmq': EOS apply_manifest(pp, :catch_failures => true) + apply_manifest(pp, :catch_changes => true) end - describe command('rabbitmqctl list_policies -p myhost') do - its(:stdout) { should match /myhost/ } - its(:stdout) { should match /ha-all/ } - its(:stdout) { should match /ha-sync-mode/ } - its(:stdout) { should match /\.\*/ } + it 'should have the policy' do + shell('rabbitmqctl list_policies -p myhost') do |r| + expect(r.stdout).to match(/myhost.*ha-all.*ha-sync-mode/) + expect(r.exit_code).to be_zero + end end end diff --git a/spec/acceptance/user_spec.rb b/spec/acceptance/user_spec.rb index 2561da624..6aab665a4 100644 --- a/spec/acceptance/user_spec.rb +++ b/spec/acceptance/user_spec.rb @@ -24,11 +24,14 @@ class { '::rabbitmq': EOS apply_manifest(pp, :catch_failures => true) + apply_manifest(pp, :catch_changes => true) end - describe command('rabbitmqctl list_users | grep dan') do - its(:stdout) { should match /dan/ } - its(:stdout) { should match /administrator/ } + it 'should have the user' do + shell('rabbitmqctl list_users') do |r| + expect(r.stdout).to match(/dan.*administrator/) + expect(r.exit_code).to be_zero + end end end diff --git a/spec/acceptance/vhost_spec.rb b/spec/acceptance/vhost_spec.rb index 701f6e228..ef1c2a342 100644 --- a/spec/acceptance/vhost_spec.rb +++ b/spec/acceptance/vhost_spec.rb @@ -23,10 +23,14 @@ class { '::rabbitmq': EOS apply_manifest(pp, :catch_failures => true) + apply_manifest(pp, :catch_changes => true) end - describe command('rabbitmqctl list_vhosts | grep myhost') do - its(:stdout) { should match /myhost/ } + it 'should have the vhost' do + shell('rabbitmqctl list_vhosts') do |r| + expect(r.stdout).to match(/myhost/) + expect(r.exit_code).to be_zero + end end end