spec/unit/msgr_spec.rb in msgr-1.4.0 vs spec/unit/msgr_spec.rb in msgr-1.5.0
- old
+ new
@@ -22,11 +22,11 @@
end
end
describe Msgr do
let(:queue) { Queue.new }
- let(:client) { Msgr::Client.new size: 1, prefix: SecureRandom.hex(2), uri: ENV['AMQP_SERVER'] }
+ let(:client) { Msgr::Client.new size: 1, prefix: SecureRandom.hex(2), uri: ENV.fetch('AMQP_SERVER', nil) }
before do
client.routes.configure do
route 'test.index', to: 'msgr_test#index'
route 'test.error', to: 'msgr_test#error'
@@ -83,10 +83,10 @@
messages[0].nack
# Test whether the nacked message gets redelivered. In this case, it was not acked when acknowledging the other message
message = Timeout.timeout(4) { queue.pop }
expect(message.payload).to eq(messages[0].payload)
- expect(message.delivery_info.redelivered).to eq(true)
+ expect(message.delivery_info.redelivered).to be(true)
expect(Receiver).to have_received(:batch).exactly(3).times
end
end