lib/bunny_mock/channel.rb in bunny-mock-1.4.0 vs lib/bunny_mock/channel.rb in bunny-mock-1.5.0

- old
+ new

@@ -233,10 +233,50 @@ # def confirm_select(callback = nil) # noop end + ## + # Does nothing atm. + # + # @return nil + # @api public + # + def prefetch(*) + # noop + end + + ## + # Does not actually wait, but always return true. + # + # @return true + # @api public + # + def wait_for_confirms(*) + true + end + + ## + # Does nothing atm. + # + # @return nil + # @api public + # + def acknowledge(*) + # noop + end + + ## + # Does nothing atm. + # + # @return nil + # @api public + # + def reject(*) + # noop + end + # @endgroup # # Implementation # @@ -258,15 +298,15 @@ exchange.add_route key, queue end # @private - def queue_unbind(key, xchg) + def queue_unbind(queue, key, xchg) exchange = @connection.find_exchange xchg raise Bunny::NotFound.new("Exchange '#{xchg}' was not found", self, false) unless exchange - exchange.remove_route key + exchange.remove_route key, queue end # @private def xchg_bound_to?(receiver, key, name) source = @connection.find_exchange name @@ -274,15 +314,15 @@ source.routes_to? receiver, routing_key: key end # @private - def xchg_routes_to?(key, xchg) + def xchg_routes_to?(queue, key, xchg) exchange = @connection.find_exchange xchg raise Bunny::NotFound.new("Exchange '#{xchg}' was not found", self, false) unless exchange - exchange.routes_to? key + exchange.routes_to? queue, routing_key: key end # @private def xchg_bind(receiver, routing_key, name) source = @connection.find_exchange name @@ -290,14 +330,14 @@ source.add_route routing_key, receiver end # @private - def xchg_unbind(routing_key, name) + def xchg_unbind(routing_key, name, exchange) source = @connection.find_exchange name raise Bunny::NotFound.new("Exchange '#{name}' was not found", self, false) unless source - source.remove_route routing_key + source.remove_route routing_key, exchange end private # @private