Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings triggered by raise_error matcher #144

Merged
merged 1 commit into from
Oct 19, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions spec/shoryuken/middleware/server/auto_delete_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ def build_message
expect(sqs_queue).to_not receive(:delete_messages)

expect {
subject.call(TestWorker.new, queue, sqs_msg, sqs_msg.body) { raise }
}.to raise_error
subject.call(TestWorker.new, queue, sqs_msg, sqs_msg.body) { raise 'Error' }
}.to raise_error(RuntimeError, 'Error')
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,19 @@
it 'does not retry the job by default' do
expect(sqs_msg).not_to receive(:change_visibility)

expect { subject.call(TestWorker.new, queue, sqs_msg, sqs_msg.body) { raise } }.to raise_error
expect {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid using {...} for multi-line blocks.

subject.call(TestWorker.new, queue, sqs_msg, sqs_msg.body) { raise 'Error' }
}.to raise_error(RuntimeError, 'Error')
end

it 'does not retry the job if :retry_intervals is empty' do
TestWorker.get_shoryuken_options['retry_intervals'] = []

expect(sqs_msg).not_to receive(:change_visibility)

expect { subject.call(TestWorker.new, queue, sqs_msg, sqs_msg.body) { raise } }.to raise_error
expect {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid using {...} for multi-line blocks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@phstc Even though @houndci is complaining, I left it as is, since you use curly brackets in other parts as well. I hope that's fine for you.

subject.call(TestWorker.new, queue, sqs_msg, sqs_msg.body) { raise 'Error' }
}.to raise_error(RuntimeError, 'Error')
end

it 'retries the job if :retry_intervals is non-empty' do
Expand Down
4 changes: 2 additions & 2 deletions spec/shoryuken/middleware/server/timing_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
end

expect {
subject.call(TestWorker.new, queue, sqs_msg, sqs_msg.body) { raise }
}.to raise_error
subject.call(TestWorker.new, queue, sqs_msg, sqs_msg.body) { raise 'Error' }
}.to raise_error(RuntimeError, 'Error')
end
end
end
2 changes: 1 addition & 1 deletion spec/shoryuken/processor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def perform(sqs_msg, body); end
it 'does not extend the message invisibility' do
expect(sqs_msg).to receive(:visibility_timeout=).never
expect_any_instance_of(TestWorker).to receive(:perform).and_raise 'worker failed'
expect { subject.process(queue, sqs_msg) }.to raise_error
expect { subject.process(queue, sqs_msg) }.to raise_error(RuntimeError, 'worker failed')
end
end
end
Expand Down