 
 
         it 'returns true', () ->
-          listenerCallback = sinon.spy()
-          testMessage = {}
-
-          testListener = @createListener listenerCallback
+          testMessage = {}
+
+          testListener = @createListener ->
           result = testListener.call testMessage
           expect(result).to.be.ok
 
         it 'calls the provided callback with true', (done) ->
-          listenerCallback = sinon.spy()
-          testMessage = {}
-
-          testListener = @createListener listenerCallback
+          testMessage = {}
+
+          testListener = @createListener ->
           testListener.call testMessage, (result) ->
             expect(result).to.be.ok
             done()
 
         it 'calls the provided callback after the function returns', (done) ->
-          listenerCallback = sinon.spy()
-          testMessage = {}
-
-          testListener = @createListener listenerCallback
+          testMessage = {}
+
+          testListener = @createListener ->
           finished = false
           testListener.call testMessage, (result) ->
             expect(finished).to.be.ok

          finished = true

        it 'does not execute any middleware', (done) ->
          listenerCallback = sinon.spy()
          testMessage = {}

          testListener = @createListener listenerCallback
          testMiddleware =
            execute: sinon.spy()




        it 'returns false', () ->
          testMessage = {}

          testListener = @createListener ->
          result = testListener.call testMessage
          expect(result).to.not.be.ok

        it 'calls the provided callback with false', (done) ->
          testMessage = {}

          testListener = @createListener ->
          testListener.call testMessage, (result) ->
            expect(result).to.not.be.ok
            done()

        it 'calls the provided callback after the function returns', (done) ->
          testMessage = {}

          testListener = @createListener ->
          finished = false
          testListener.call testMessage, (result) ->
            expect(finished).to.be.ok
