Skip to content

Commit

Permalink
Cleaner code
Browse files Browse the repository at this point in the history
  • Loading branch information
spuun committed Aug 23, 2024
1 parent e163d5d commit 18f686b
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions spec/amqp-client_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -419,19 +419,15 @@ describe AMQP::Client do
q.publish "foobar"
expect_raises(AMQP::Client::Connection::ClosedException) do
ch.basic_consume q.name, block: true do
with_http_api do |api|
api.close_connections(1)
end
with_http_api &.close_connections(1)
end
end
end
end

it "#basic_publish" do
with_channel do |ch|
with_http_api do |api|
api.close_connections(1)
end
with_http_api &.close_connections(1)
sleep 1 # Wait for connection to be closed
expect_raises(AMQP::Client::Connection::ClosedException) do
ch.basic_publish "", "", "foobar"
Expand All @@ -441,9 +437,7 @@ describe AMQP::Client do

it "#basic_publish_confirm" do
with_channel do |ch|
with_http_api do |api|
api.close_connections(1)
end
with_http_api &.close_connections(1)
sleep 1 # Wait for connection to be closed
expect_raises(AMQP::Client::Connection::ClosedException) do
ch.basic_publish_confirm "", "", "foobar"
Expand Down

0 comments on commit 18f686b

Please sign in to comment.