Takes a hash to specify the exchange type and its name.
topic = mock_exchange(:topic => 'topic exchange')
# File lib/moqueue/object_methods.rb, line 21 def mock_exchange(opts={}) MockExchange.new(opts) end
Takes a string name as a parameter. Each queue name may only be used once. Multiple calls to mock_queue with the same name will return the same object.
# File lib/moqueue/object_methods.rb, line 14 def mock_queue(name=nil) MockQueue.new(name || "anonymous-#{rand(2**32).to_s(16)}") end
# File lib/moqueue/object_methods.rb, line 4 def mock_queue_and_exchange(name=nil) queue = mock_queue(name) exchange = mock_exchange exchange.attached_queues << queue [queue, exchange] end
Generated with the Darkfish Rdoc Generator 2.