Skip to content
This repository has been archived by the owner on Apr 16, 2019. It is now read-only.

Commit

Permalink
create tmp/test-testbed directory when starting test/controllers.gith…
Browse files Browse the repository at this point in the history
…ub.asynct
  • Loading branch information
dominictarr committed Jun 15, 2011
1 parent fdfa5a4 commit cef9183
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions test/controllers.github.asynct.js
Expand Up @@ -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')
Expand All @@ -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()
})
})

}
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit cef9183

Please sign in to comment.