feature(cloudcmd) --columns: add ability to set visible columns (#146)

This commit is contained in:
coderaiser 2018-03-02 18:00:15 +02:00
parent 6c9913e5f1
commit b5f98be162
18 changed files with 115 additions and 30 deletions

View file

@ -107,6 +107,37 @@ test('validate: editor: not valid', (t) => {
t.end();
});
test('validate: columns', (t) => {
const fn = sinon.stub();
clean();
require(exitPath);
stub(exitPath, fn);
const {columns} = require(validatePath);
columns('name-size-date');
t.notOk(fn.called, 'should not call exit');
t.end();
});
test('validate: columns: wrong', (t) => {
const fn = sinon.stub();
clean();
require(exitPath);
stub(exitPath, fn);
const {columns} = require(validatePath);
const msg = 'cloudcmd --columns: could be "name-size-date" or "name-size-date-owner-mode"';
columns('hello');
t.ok(fn.calledWith(msg), 'should call exit');
t.end();
});
function clean() {
clear(validatePath);
clear(exitPath);