diff --git a/lib/commands/create.js b/lib/commands/create.js index da6f3fa..d223f8d 100644 --- a/lib/commands/create.js +++ b/lib/commands/create.js @@ -25,6 +25,7 @@ module.exports = { function create (opts) { opts.resume = false // cannot resume for create + if (opts._.length) opts.dir = opts._[0] var importStatus = null diff --git a/tests/create.js b/tests/create.js index 49e4b3d..7679cc8 100644 --- a/tests/create.js +++ b/tests/create.js @@ -120,6 +120,22 @@ test('create - init alias okay', function (t) { st.end() }) +test('create - with path', function (t) { + rimraf.sync(path.join(fixtures, '.dat')) + var cmd = dat + ' create ' + fixtures + var st = spawn(t, cmd) + + st.stderr.empty() + st.stdout.match(function (output) { + var importFinished = output.indexOf('import finished') > -1 + if (!importFinished) return false + t.ok(output.indexOf('dat-next/tests/fixtures'), 'prints correct dir') + st.kill() + return true + }) + st.end() +}) + test.onFinish(function () { rimraf.sync(path.join(fixtures, '.dat')) })