Permalink
Browse files

pass along other options to bunny -- especially :user and :pass

  • Loading branch information...
1 parent 4c1d10f commit cd4603034a85a16684d3be2b2f38a481c0844e7a David Anderson committed with Aug 24, 2010
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/amqp_logging/log_device.rb
  2. +1 −1 test/logger_test.rb
@@ -50,7 +50,7 @@ def exchange
end
def bunny
- @bunny ||= Bunny.new(:host => configuration[:host])
+ @bunny ||= Bunny.new(configuration)
@bunny
end
View
@@ -72,7 +72,7 @@ class TheLogDeviceTest < Test::Unit::TestCase
test "should initialize the AMQP components correctly" do
config = { :queue => "testqueue", :exchange => "testexchange", :host => "testhost", :shift_age => 4, :shift_size => 1338 }
bunny_stub = stub_everything("bunny_stub")
- Bunny.expects(:new).with(:host => "testhost").returns(bunny_stub)
+ Bunny.expects(:new).with(config.merge({:routing_key => "logs"})).returns(bunny_stub)
bunny_stub.expects(:exchange).with(config[:exchange], :type => :topic).returns(stub("exchange stub", :publish => true))
logger = AMQPLogging::Logger.new(StringIO.new, config)

0 comments on commit cd46030

Please sign in to comment.