write correct one

This commit is contained in:
Peter Cottle 2013-10-29 10:07:13 -07:00
parent 1bd2f5de64
commit 30b1f58e77

View file

@ -6,11 +6,19 @@ prompt = require('prompt');
function getFile(truthy) { function getFile(truthy) {
var filename = (truthy) ? var filename = (truthy) ?
'./remote.spec.js' : './git.spec.js' :
'./git.spec.js'; './remote.spec.js';
return fs.readFileSync(filename, 'utf8'); return fs.readFileSync(filename, 'utf8');
} }
function writeFile(truthy, content) {
var filename = (truthy) ?
'./git.spec.js' :
'./remote.spec.js';
fs.writeFileSync(filename, content);
}
prompt.start(); prompt.start();
prompt.get( prompt.get(
@ -34,7 +42,7 @@ prompt.get(
var funcCall = "\tit('" + result.whatItDoes + "', function() {\n" + var funcCall = "\tit('" + result.whatItDoes + "', function() {\n" +
testCase + "\t});\n\n"; testCase + "\t});\n\n";
fs.writeFileSync('./remote.spec.js', partOne + funcCall + partTwo); writeFile(result.intoGitSpec, partOne + funcCall + partTwo);
}, 100); }, 100);
} }
); );