 sinon = require 'sinon'
 request = require 'superagent'
+querystring = require 'querystring'
 esa = require "#{process.env.PWD}/src"
+
+endpoint = 'https://api.esa.io'
+baseScheme = '/v1/teams'
 
 httpMethods = [
   'get'

    for key, sinonObjects of sinonObjects
      do sinonObjects.restore

  describe 'exec', ->

    httpMethods.forEach (method)->
      it "methodが #{method} であれば request.#{method} がコールされる", ->
        sinonObjects.request = sinon.stub request, method, requestStub(method)
        client = esa()
        client.exec method, 'urlString', (err, ret)->
          ret.body.name.should.equal method

    it "method がその他の値であれば request.get がコールされる", ->
      method = 'get'
      sinonObjects.request = sinon.stub request, method, requestStub(method)
      client = esa()
      client.exec 'otherMethod', 'urlString', (err, ret)->
        ret.body.name.should.equal method



  'del'
]

# request(superagent)用stub
requestStub = (name)->
  (url)->
    {
