anchor.diff:  -include_lib("amqp_client/include/amqp_client.hrl").
   
   spec() ->
  +  before_all(fun() ->
  +        meck:new([amqp_connection, amqp_channel]),
  +        meck:expect(amqp_connection, start, 1, connection),
  +        meck:expect(amqp_connection, open_channel, 1, {ok, channel})
  +    end),
  +
  +  after_all(fun() ->
  +        meck:unload([amqp_connection, amqp_channel])
  +    end),
  +
     describe("declare/1", fun() ->
           it("should create a exclusive, server named queue", fun()->
  -              meck:new([amqp_connection, amqp_channel]),
  -              meck:expect(amqp_connection, start, 1, connection),
  -              meck:expect(amqp_connection, open_channel, 1, {ok, channel}),
                 meck:expect(amqp_channel, call, 2, #'queue.declare_ok'{ queue = <<"abc">>}),
   
                 Params = #'queue.declare'{exclusive = true},
  
positive.code:               {ok, QueueName} = coello_queue:declare(Channel),
  
                assert_that(meck:called(amqp_channel, call, [Channel, Params]), is(true)),
                assert_that(QueueName, is(<<"abc">>)),
  
                meck:unload([amqp_connection, amqp_channel])
          end)
    end),
  describe("bind/4", fun() ->
        it("should bind the queue with the passed in routing key", fun()->
              meck:new([amqp_connection, amqp_channel]),
              meck:expect(amqp_connection, start, 1, connection),
              meck:expect(amqp_connection, open_channel, 1, {ok, channel}),
              meck:sequence(amqp_channel, call, 2,
                [#'queue.declare_ok'{}, #'queue.bind_ok'{}]),
  
  
negative.code:             Params     = #'queue.bind'{queue = QueueName, exchange = Exchange, routing_key = RoutingKey },
              coello_queue:bind(Channel, QueueName, RoutingKey, Exchange),
  
              assert_that(meck:called(amqp_channel, call, [Channel, Params]), is(true))
          end)
    end).
  