       giphyPluginInstance = hubotGiphy robot
       @fakes.stub giphyPluginInstance.api, '_request', (options, callback) -> callback 'XHR Attempted', null
       @fakes.stub giphyPluginInstance, 'respond'
+
+    it 'api instance should default to http', ->
+      giphyPluginInstance = hubotGiphy robot
+      giphyPluginInstance.api.httpService.globalAgent.protocol.should.match /^http:$/
+
+    it 'api instance supports enabling https via HUBOT_GIPHY_HTTPS', ->
+      process.env.HUBOT_GIPHY_HTTPS = 'true'
+      giphyPluginInstance = hubotGiphy robot
+      giphyPluginInstance.api.httpService.globalAgent.protocol.should.match /^https:$/
+
+    it 'api instance supports overriding the timeout via HUBOT_GIPHY_TIMEOUT', ->
+      process.env.HUBOT_GIPHY_TIMEOUT = '123'
+      giphyPluginInstance = hubotGiphy robot
+      giphyPluginInstance.api.timeout.should.eql 123
+
+    it 'api instance supports setting the api key via HUBOT_GIPHY_API_KEY', ->
+      process.env.HUBOT_GIPHY_API_KEY = 'testing'
+      giphyPluginInstance = hubotGiphy robot
+      giphyPluginInstance.api.apiKey.should.eql 'testing'
 
     it 'has an active respond trigger', ->
       robot.respond.should.have.been.called.once

        state.endpoint.should.eql 'test1'
        state.args.should.eql 'test2'

      it 'handles only args match', ->
        state = { }
        @fakes.stub @giphy, 'match', -> [ null, null, 'test2' ]

        @fakes.stub @giphy, 'getUri'
        @fakes.stub @giphy, 'error'

      it 'handles non-empty matched args', ->
        msg = { match: [ null, 'testing' ] }
        state = 'state'
        @fakes.stub @giphy, 'createState', -> state
