Custom target should not affect usage and help message generation

This commit is contained in:
mpeterv
2014-08-25 13:51:08 +04:00
parent b02536d6ba
commit bd5fd00e6c
4 changed files with 8 additions and 8 deletions

View File

@@ -60,7 +60,7 @@ describe("tests related to CLI behaviour #unsafe", function()
it("generates correct error message without arguments in command", function()
local handler = io.popen("./spec/script foo install 2>&1", "r")
assert.equal(table.concat({
"Usage: ./spec/script install [-f <server>] [-h] <rock> [<version>]",
"Usage: ./spec/script install [-f <from>] [-h] <rock> [<version>]",
"",
"Error: too few arguments",
""
@@ -71,7 +71,7 @@ describe("tests related to CLI behaviour #unsafe", function()
it("generates correct error message and tip in command", function()
local handler = io.popen("./spec/script foo install bar --form=there 2>&1", "r")
assert.equal(table.concat({
"Usage: ./spec/script install [-f <server>] [-h] <rock> [<version>]",
"Usage: ./spec/script install [-f <from>] [-h] <rock> [<version>]",
"",
"Error: unknown option '--form'",
"Did you mean '--from'?",
@@ -106,7 +106,7 @@ describe("tests related to CLI behaviour #unsafe", function()
it("generates correct help message for command", function()
local handler = io.popen("./spec/script foo install --help 2>&1", "r")
assert.equal(table.concat({
"Usage: ./spec/script install [-f <server>] [-h] <rock> [<version>]",
"Usage: ./spec/script install [-f <from>] [-h] <rock> [<version>]",
"",
"Install a rock. ",
"",
@@ -115,7 +115,7 @@ describe("tests related to CLI behaviour #unsafe", function()
" version Version of the rock. ",
"",
"Options: ",
" -f <server>, --from <server>",
" -f <from>, --from <from>",
" Fetch the rock from this server. ",
" -h, --help Show this help message and exit. ",
"",