Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

create tmp/test-testbed directory when starting test/controllers.gith…

…ub.asynct
  • Loading branch information...
commit cef9183c79b1c6134bf1e04262ea99b13c62df00 1 parent fdfa5a4
@dominictarr authored
Showing with 13 additions and 9 deletions.
  1. +13 −9 test/controllers.github.asynct.js
View
22 test/controllers.github.asynct.js
@@ -2,6 +2,8 @@
var Github = require('../controllers/github')
, valid = require('./lib/validate')
, Testbed = require('../testbed')
+ , exec = require('child_process').exec
+ , tmp = '/tmp/test-testbed'
, it = require('it-is')
, fs = require('fs')
, render = require('render')
@@ -15,14 +17,16 @@ var Github = require('../controllers/github')
exports.__setup = function (test){
- console.error("init database")
- console.log(opts)
- db = require('../initialize')(opts, function (err,db){
- if(err){
- console.error("DATABASE SETUP ERROR")
- throw err
- }
- test.done()
+ exec('rm -rf ' + tmp + '; mkdir ' + tmp, function (){
+ console.error("init database")
+ console.log(opts)
+ db = require('../initialize')(opts, function (err,db){
+ if(err){
+ console.error("DATABASE SETUP ERROR")
+ throw err
+ }
+ test.done()
+ })
})
}
@@ -74,7 +78,7 @@ function MockRepo (){
process.nexTick(function (){ callback(null, {ok: 'true'}) })
}
}*/
-var github = Github(db,new Testbed('/tmp/test-testbed').Repo, {basedir: __dirname + '/tmp'})
+var github = Github(db,new Testbed(tmp).Repo, {basedir: __dirname + '/tmp'})
, post = {
repository: {
name: 'curry',
Please sign in to comment.
Something went wrong with that request. Please try again.