Skip to content

Commit

Permalink
Merge pull request voxpupuli#602 from wyardley/multiple_expectations3
Browse files Browse the repository at this point in the history
Ignore remaining multiple expectations warnings
  • Loading branch information
alexjfisher authored Sep 5, 2017
2 parents d72c385 + 866fc55 commit 0968514
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions spec/acceptance/parameter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ class { '::rabbitmq':
apply_manifest(pp, catch_changes: true)
end

# rubocop:disable RSpec/MultipleExpectations
it 'has the parameter' do
shell('rabbitmqctl list_parameters -p fedhost') do |r|
expect(r.stdout).to match(%r{federation-upstream.*documentumFed.*expires.*3600000})
expect(r.exit_code).to be_zero
end
end
# rubocop:enable RSpec/MultipleExpectations
end
end
2 changes: 2 additions & 0 deletions spec/acceptance/policy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,14 @@ class { '::rabbitmq':
expect(apply_manifest(pp, catch_changes: true).exit_code).to be_zero
end

# rubocop:disable RSpec/MultipleExpectations
it 'has the policy' do
shell('rabbitmqctl list_policies -p myhost') do |r|
expect(r.stdout).to match(%r{myhost.*ha-all.*ha-sync-mode})
expect(r.stdout).to match(%r{myhost.*eu-federation})
expect(r.exit_code).to be_zero
end
end
# rubocop:enable RSpec/MultipleExpectations
end
end
6 changes: 6 additions & 0 deletions spec/acceptance/queue_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class { '::rabbitmq':
apply_manifest(pp, catch_changes: true)
end

# rubocop:disable RSpec/MultipleExpectations
it 'has the binding' do
shell('rabbitmqctl list_bindings -q -p host1') do |r|
expect(r.stdout).to match(%r{exchange1\sexchange\squeue1\squeue\s#})
Expand All @@ -73,6 +74,7 @@ class { '::rabbitmq':
expect(r.exit_code).to be_zero
end
end
# rubocop:enable RSpec/MultipleExpectations
end

context 'create multiple bindings when same source / destination / vhost but different routing keys' do
Expand Down Expand Up @@ -148,13 +150,15 @@ class { '::rabbitmq':
apply_manifest(pp, catch_changes: true)
end

# rubocop:disable RSpec/MultipleExpectations
it 'has the bindings' do
shell('rabbitmqctl list_bindings -q -p host1') do |r|
expect(r.stdout).to match(%r{exchange1\sexchange\squeue1\squeue\stest1})
expect(r.stdout).to match(%r{exchange1\sexchange\squeue1\squeue\stest2})
expect(r.exit_code).to be_zero
end
end
# rubocop:enable RSpec/MultipleExpectations
end

context 'create binding and queue resources when using a non-default management port' do
Expand Down Expand Up @@ -217,6 +221,7 @@ class { '::rabbitmq':
apply_manifest(pp, catch_changes: true)
end

# rubocop:disable RSpec/MultipleExpectations
it 'has the binding' do
shell('rabbitmqctl list_bindings -q -p host2') do |r|
expect(r.stdout).to match(%r{exchange2\sexchange\squeue2\squeue\s#})
Expand All @@ -230,5 +235,6 @@ class { '::rabbitmq':
expect(r.exit_code).to be_zero
end
end
# rubocop:enable RSpec/MultipleExpectations
end
end
2 changes: 2 additions & 0 deletions spec/acceptance/user_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ class { '::rabbitmq':
apply_manifest(pp, catch_changes: true)
end

# rubocop:disable RSpec/MultipleExpectations
it 'has the user' do
shell('rabbitmqctl list_users') do |r|
expect(r.stdout).to match(%r{dan.*administrator})
expect(r.exit_code).to be_zero
end
end
# rubocop:enable RSpec/MultipleExpectations
end
end
2 changes: 2 additions & 0 deletions spec/acceptance/vhost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ class { '::rabbitmq':
apply_manifest(pp, catch_changes: true)
end

# rubocop:disable RSpec/MultipleExpectations
it 'has the vhost' do
shell('rabbitmqctl list_vhosts') do |r|
expect(r.stdout).to match(%r{myhost})
expect(r.exit_code).to be_zero
end
end
# rubocop:enable RSpec/MultipleExpectations
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
end
let(:provider) { provider_class.new(resource) }

# rubocop:disable RSpec/MultipleExpectations
describe '#instances' do
it 'returns instances' do
provider_class.expects(:rabbitmqctl).with('list_vhosts', '-q').returns <<-EOT
Expand All @@ -41,7 +42,9 @@
}
])
end
# rubocop:enable RSpec/MultipleExpectations

# rubocop:disable RSpec/MultipleExpectations
it 'returns multiple instances' do
provider_class.expects(:rabbitmqctl).with('list_vhosts', '-q').returns <<-EOT
/
Expand Down Expand Up @@ -75,6 +78,7 @@
])
end
end
# rubocop:enable RSpec/MultipleExpectations

describe 'Test for prefetch error' do
let(:resource) do
Expand Down
2 changes: 2 additions & 0 deletions spec/unit/puppet/type/rabbitmq_user_permissions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
end.to raise_error(Puppet::Error, %r{Invalid regexp})
end
end
# rubocop:disable RSpec/MultipleExpectations
{ rabbitmq_vhost: 'dan@test', rabbitmq_user: 'test@dan' }.each do |k, v|
it "should autorequire #{k}" do
vhost = if k == :rabbitmq_vhost
Expand All @@ -52,4 +53,5 @@
expect(rel.target.ref).to eq(perm.ref)
end
end
# rubocop:enable RSpec/MultipleExpectations
end

0 comments on commit 0968514

Please sign in to comment.