         @giphy.match.should.be.calledWith state.input
 
       it 'handles null match result', ->
-        state = {}
+        state = { }
         @fakes.stub @giphy, 'match', -> null
         @giphy.getEndpoint state
         state.endpoint.should.eql ''
         state.args.should.eql ''
 
       it 'handles endpoint and args match', ->
-        state = {}
+        state = { }
         @fakes.stub @giphy, 'match', -> [ null, 'test1', 'test2' ]
         @giphy.getEndpoint state
         state.endpoint.should.eql 'test1'
         state.args.should.eql 'test2'
 
       it 'handles only args match', ->
-        state = {}
+        state = { }
         @fakes.stub @giphy, 'match', -> [ null, null, 'test2' ]
         @giphy.getEndpoint state
-        state.endpoint.should.eql @giphy.constructor.defaultEndpoint
+        state.endpoint.should.eql @giphy.defaultEndpoint
         state.args.should.eql 'test2'
 
     describe '.getNextOption', ->
       it 'handles empty args', ->
-        state = { args: '', options: {} }
+        state = { args: '', options: { } }
         optionFound = @giphy.getNextOption state
         optionFound.should.be.false
         state.args.should.eql ''
-        state.options.should.eql {}
+        state.options.should.eql { }
 
       it 'handles a single non-switch arg', ->
-        state = { args: 'test1', options: {} }
+        state = { args: 'test1', options: { } }
         optionFound = @giphy.getNextOption state
         optionFound.should.be.false
         state.args.should.eql 'test1'
-        state.options.should.eql {}
+        state.options.should.eql { }
 
       it 'handles multiple non-switch args', ->
-        state = { args: 'test1 test2', options: {} }
+        state = { args: 'test1 test2', options: { } }
         optionFound = @giphy.getNextOption state
         optionFound.should.be.false
         state.args.should.eql 'test1 test2'
-        state.options.should.eql {}
+        state.options.should.eql { }
 
       it 'handles a single numerical switch', ->
-        state = { args: '/test1:1', options: {} }
+        state = { args: '/test1:1', options: { } }
         optionFound = @giphy.getNextOption state
         optionFound.should.be.true
         state.args.should.eql ''
         state.options.should.eql { test1: 1 }
 
       it 'handles a single non-numerical switch', ->
-        state = { args: '/test1:test1', options: {} }
+        state = { args: '/test1:test1', options: { } }
         optionFound = @giphy.getNextOption state
         optionFound.should.be.true
         state.args.should.eql ''
         state.options.should.eql { test1: 'test1' }
 
       it 'handles multiple switches', ->
-        state = { args: '/test1:1 /test2:2', options: {} }
+        state = { args: '/test1:1 /test2:2', options: { } }
         optionFound = @giphy.getNextOption state
         optionFound.should.be.true
         state.args.should.eql '/test2:2'
         state.options.should.eql { test1: 1 }
 
       it 'handles switches before args', ->
-        state = { args: '/test1:1 test2', options: {} }
+        state = { args: '/test1:1 test2', options: { } }
         optionFound = @giphy.getNextOption state
         optionFound.should.be.true
         state.args.should.eql 'test2'
         state.options.should.eql { test1: 1 }
 
       it 'handles switches after args', ->
-        state = { args: 'test1 /test2:2', options: {} }
+        state = { args: 'test1 /test2:2', options: { } }
         optionFound = @giphy.getNextOption state
         optionFound.should.be.true
         state.args.should.eql 'test1'
         state.options.should.eql { test2: 2 }
 
       it 'handles mixed switches and args', ->
-        state = { args: '/test1:1 test 2 /test3:test3', options: {} }
+        state = { args: '/test1:1 test 2 /test3:test3', options: { } }
         optionFound = @giphy.getNextOption state
         optionFound.should.be.true
         state.args.should.eql 'test 2 /test3:test3'

        @giphy.sendMessage.should.be.calledWith 'msg', 'uri'

      it 'handles state without a uri', ->
        @giphy.sendResponse {}
        @giphy.error.should.be.called.once

    describe '.sendMessage', ->
      it 'sends a message when msg and message are valid', ->
        @giphy.sendMessage @msg, 'testing'
        @msg.send.should.be.called.once
        @msg.send.should.be.calledWith 'testing'

      it 'ignores calls when msg or message is null', ->
        @giphy.sendMessage()
        @giphy.sendMessage @msg
        @giphy.sendMessage @msg, null
        @giphy.sendMessage undefined, 'testing'
        @giphy.sendMessage null, 'testing'
        @msg.send.should.not.have.been.called

    describe '.respond', ->
      beforeEach ->

        @giphy.getNextOption.should.be.called.twice
        @giphy.getNextOption.should.be.calledWith state
        should.exist state.options
        state.options.should.eql { }

      it 'parses mixed switches and args', ->
        state = { args: '/test1:1 test 2 /test3:test3' }
