 
     describe '.getRandomResult', ->
       it 'calls the callback with a single value collection', ->
-        callback = sinon.stub().returns 'result'
+        callback = @fakes.stub().returns 'result'
         result = @giphy.getRandomResult [ 'testing' ], callback
         callback.should.have.been.called.once
         callback.should.have.been.calledWith 'testing'


describe 'giphy', ->
  beforeEach ->
    @robot = {
      respond: sinon.spy()
    }

    @msg = {
      send: sinon.spy()
    }

    @giphy = giphy @robot
    sinon.stub @giphy.api, '_request', (options, callback) -> callback null, null

  afterEach ->
    @giphy.api._request.restore()

  describe 'test instrumentation', ->
    it 'has a valid class instance', ->


    describe '.error', ->
      beforeEach ->
        @fakes.stub @giphy, 'sendMessage'

      it 'sends the reason if msg and reason exist', ->
        @giphy.error @msg, 'test'
