This repository has been archived on 2020-01-20. You can view files and clone it, but cannot push or open issues or pull requests.
node-spearhead/test/integration/cli-basics.test.js
2015-09-01 00:31:00 -07:00

71 lines
1.8 KiB
JavaScript

/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/*
* Copyright (c) 2015, Joyent, Inc.
*/
/*
* Integration tests for `triton ...` CLI basics.
*/
var h = require('./helpers');
var test = require('tape');
// --- Globals
// --- Tests
test('triton (basics)', function (tt) {
tt.test(' triton --version', function (t) {
h.triton('--version', function (err, stdout, stderr) {
if (h.ifErr(t, err, 'triton --version'))
return t.end();
t.ok(/^triton \d+\.\d+\.\d+/.test(stdout));
t.end();
});
});
tt.test(' triton -h', function (t) {
h.triton('-h', function (err, stdout, stderr) {
if (h.ifErr(t, err))
return t.end();
t.ok(/^Usage:$/m.test(stdout));
t.ok(/triton help COMMAND/.test(stdout));
t.ok(/create-instance/.test(stdout));
t.end();
});
});
tt.test(' triton --help', function (t) {
h.triton('--help', function (err, stdout, stderr) {
if (h.ifErr(t, err))
return t.end();
t.ok(/^Usage:$/m.test(stdout));
t.ok(/triton help COMMAND/.test(stdout));
t.ok(/create-instance/.test(stdout));
t.end();
});
});
tt.test(' triton help', function (t) {
h.triton('help', function (err, stdout, stderr) {
if (h.ifErr(t, err))
return t.end();
t.ok(/^Usage:$/m.test(stdout));
t.ok(/triton help COMMAND/.test(stdout));
t.ok(/create-instance/.test(stdout));
t.end();
});
});
});