Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
CB-5736 - target host is a required field
  • Loading branch information
bryanhiggins committed Jan 7, 2014
1 parent 9ae84e6 commit 048fda1186a724378e4ed12125a714002670b9a0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
@@ -91,6 +91,11 @@ commander
console.log(commander.helpInformation());
exit(ERROR_VALUE);
}
if (typeof ip !== 'string') {
console.log("host is required");
console.log(commander.helpInformation());
exit(ERROR_VALUE);
}
if (!isValidPin(pin)) {
console.log("Invalid PIN: " + pin);
console.log(commander.helpInformation());
@@ -96,21 +96,16 @@ describe("cordova/target tests", function () {
expect(_output).toContain("Target details not specified");
});

it("should require ip for add", function () {
it("should require host for add", function () {
executeScript(TARGET_COMMAND, ["add", "z10"], true);
expect(_output).toContain("IP is required");
expect(_output).toContain("host is required");
});

it("should warn unrecognized command", function () {
executeScript(TARGET_COMMAND, ["bleh"], true);
expect(_output).toContain("Unrecognized command");
});

it("should warn invalid ip", function () {
executeScript(TARGET_COMMAND, ["add", "z10", "256.254.0.1"], true);
expect(_output).toContain("Invalid IP: 256.254.0.1");
});

it("should warn invalid type", function () {
executeScript(TARGET_COMMAND, ["add", "z10", "169.254.0.1", "-t", "bleh"], true);
expect(_output).toContain("Invalid target type: bleh");

0 comments on commit 048fda1

Please sign in to comment.