Skip to content

Commit

Permalink
Merge pull request #2 from cmurphy/fix_266
Browse files Browse the repository at this point in the history
Improve rabbitmq type acceptance tests
  • Loading branch information
nibalizer committed Dec 17, 2014
2 parents dac9d75 + 43906f5 commit 3741e86
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
11 changes: 6 additions & 5 deletions spec/acceptance/policy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions spec/acceptance/user_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions spec/acceptance/vhost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3741e86

Please sign in to comment.