Skip to content

Commit

Permalink
Updating error message tests to account for new "list" option
Browse files Browse the repository at this point in the history
Fixes #5920
  • Loading branch information
ycombinator authored and epixa committed Jan 16, 2016
1 parent a64f2cb commit 904d91a
Showing 1 changed file with 28 additions and 3 deletions.
31 changes: 28 additions & 3 deletions src/cli/plugin/__tests__/setting_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,44 @@ describe('kibana cli', function () {
options = { install: 'dummy/dummy', pluginDir: fromRoot('installedPlugins') };
});

it('should require the user to specify either install and remove', function () {
it('should require the user to specify either install, remove, or list', function () {
options.install = null;
parser = settingParser(options);

expect(parser.parse).withArgs().to.throwError(/Please specify either --install or --remove./);
expect(parser.parse).withArgs().to.throwError(/Please specify either --install, --remove, or --list./);
});

it('should not allow the user to specify both install and remove', function () {
options.remove = 'package';
options.install = 'org/package/version';
parser = settingParser(options);

expect(parser.parse).withArgs().to.throwError(/Please specify either --install or --remove./);
expect(parser.parse).withArgs().to.throwError(/Please specify either --install, --remove, or --list./);
});

it('should not allow the user to specify both install and list', function () {
options.list = true;
options.install = 'org/package/version';
parser = settingParser(options);

expect(parser.parse).withArgs().to.throwError(/Please specify either --install, --remove, or --list./);
});

it('should not allow the user to specify both remove and list', function () {
options.list = true;
options.remove = 'package';
parser = settingParser(options);

expect(parser.parse).withArgs().to.throwError(/Please specify either --install, --remove, or --list./);
});

it('should not allow the user to specify install, remove, and list', function () {
options.list = true;
options.install = 'org/package/version';
options.remove = 'package';
parser = settingParser(options);

expect(parser.parse).withArgs().to.throwError(/Please specify either --install, --remove, or --list./);
});

describe('quiet option', function () {
Expand Down

0 comments on commit 904d91a

Please sign in to comment.