         before (done) ->
           ramlFile = "#{RAML_DIR}/machines-1_get_1_post.raml"
           ramlParser.loadFile(ramlFile)
-          .then (raml) ->
-            callback = sinon.stub()
-            callback.returns(done())
-
-            addTests raml, tests, hooks, callback, testFactory, false
-          .catch (err) ->
-            console.error err
-            done(err)
+            .then (raml) ->
+              callback = sinon.stub()
+              callback.returns(done())
+
+              addTests raml, tests, hooks, callback, testFactory, false
+            .catch (err) ->
+              console.error err
+              done(err)
           return
 
         after () ->

      before (done) ->
        ramlFile = "#{RAML_DIR}/machines-non_required_query_parameter.raml"
        ramlParser.loadFile(ramlFile)
        .then (raml) ->
          callback = sinon.stub()
          callback.returns(done())

          addTests raml, tests, hooks, callback, testFactory, false
        .catch (err) ->
          console.error err
          done(err)
        return

      after () ->

      callback = undefined

      before (done) ->
        ramlFile = "#{RAML_DIR}/machines-required_query_parameter.raml"
        ramlParser.loadFile(ramlFile)
          .then (raml) ->
            callback = sinon.stub()
            callback.returns(done())

            addTests raml, tests, hooks, callback, testFactory, false
          .catch (err) ->
            console.error err
            done(err)
        return

      after () ->
