spec/unit/channel_connector_spec.rb in pwwka-0.18.0 vs spec/unit/channel_connector_spec.rb in pwwka-0.19.0
- old
+ new
@@ -24,9 +24,28 @@
it "does not set a prefetch value unless configured" do
expect(bunny_channel).not_to receive(:prefetch).with(10)
described_class.new
end
+
+ it "sets a connection_name if configured to do so" do
+ expect(Bunny).to receive(:new).with(
+ /amqp:\/\/guest:guest@localhost:/,
+ {:client_properties=>{:connection_name=>"test_connection"},
+ :automatically_recover=>false,
+ :allow_delayed=>true})
+
+ described_class.new(connection_name: "test_connection")
+ end
+
+ it "only contains default options if none provided" do
+ expect(Bunny).to receive(:new).with(
+ /amqp:\/\/guest:guest@localhost:/,
+ {:automatically_recover=>false, :allow_delayed=>true})
+
+ described_class.new
+ end
+
end
describe "raise_if_delayed_not_allowed" do
before do
allow(Bunny).to receive(:new).and_return(bunny_session)