Skip to content

Commit

Permalink
Add spec
Browse files Browse the repository at this point in the history
  • Loading branch information
spuun authored and carlhoerberg committed Nov 21, 2024
1 parent c9725e8 commit 9f1adcb
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions spec/amqproxy/server_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -242,4 +242,21 @@ describe AMQProxy::Server do
end
end
end

it "should treat all frames as heartbeats" do
with_server do |server, proxy_url|
Fiber.yield
AMQP::Client.start("#{proxy_url}?heartbeat=1") do |conn|
client = server.@clients.first?.should_not be_nil
last_heartbeat = client.@last_heartbeat
conn.channel
Fiber.yield
client.@last_heartbeat.should be > last_heartbeat
last_heartbeat = client.@last_heartbeat
conn.write AMQ::Protocol::Frame::Heartbeat.new
Fiber.yield
client.@last_heartbeat.should be > last_heartbeat
end
end
end
end

0 comments on commit 9f1adcb

Please sign in to comment.