 Sails     = require("sails/lib/app")
 sailsLift = require("sails/bin/sails-lift")
 
+# -- PRIVATE ------------------------------------------------------------------
+
 appName      = "testApp"
 appName_path = path.join(__dirname, "../" + appName)
 
-change_path = (path) ->
+_change_path = (path) ->
   new_path = path or appName_path
   process.chdir new_path
 
 # Make existsSync not crash on older versions of Node
 fs.existsSync = fs.existsSync or path.existsSync
 
+# -- PUBLIC ------------------------------------------------------------------
+
 ###
 Create a new proyect using 'sails new' command
 @param  {[Function]} done Callback
 @return {[Function]}      Callback
 ###
-_build = (done) ->
+build = (done) ->
 
   # Cleanup old test fixtures
-  _clean()
+  clean()
   exec sailsBin + " new " + appName, (err) ->
     if done
       return done(err)  if err
       done()
 
-###*
- * @description Lift a Sails Server
- * @return      {[Functon]} Callback
 ###
-_lift = -> # dir, options, done
+@description Lift a Sails Server
+@return      {[Functon]} Callback
+###
+lift = -> # dir, options, done
   delete process.env.NODE_ENV
   args = Args([
     {dir:     Args.STRING   | Args.Optional, _default: appName_path}

      sails.kill = sails.lower
      done null, sails

###*
 * Concatenate build and lift actions
 * @param  {[type]}   options Sails option object
 * @param  {Function} done    Callback
 * @return {[type]}           Callback
###
_buildAndLift = (options, done) ->
  _build -> _lift options, done

###*
 * Clean a proyect
###
_clean = -> # dir
  args = Args([
    {dir:     Args.STRING   | Args.Optional, _default: appName_path}
  ], arguments)

  dir     = args.dir
  options = args.options
  done    = args.done
  _change_path dir

  _.defaults options,
    # defaults options. Only can be overwritten
