From 30b1f58e77d184494a046e22d00a093fb212e8d9 Mon Sep 17 00:00:00 2001 From: Peter Cottle Date: Tue, 29 Oct 2013 10:07:13 -0700 Subject: [PATCH] write correct one --- spec/create.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/spec/create.js b/spec/create.js index 96eef561..6e9d24bd 100644 --- a/spec/create.js +++ b/spec/create.js @@ -6,11 +6,19 @@ prompt = require('prompt'); function getFile(truthy) { var filename = (truthy) ? - './remote.spec.js' : - './git.spec.js'; + './git.spec.js' : + './remote.spec.js'; 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.get( @@ -34,7 +42,7 @@ prompt.get( var funcCall = "\tit('" + result.whatItDoes + "', function() {\n" + testCase + "\t});\n\n"; - fs.writeFileSync('./remote.spec.js', partOne + funcCall + partTwo); + writeFile(result.intoGitSpec, partOne + funcCall + partTwo); }, 100); } );