features/todo.feature in gli-2.8.1 vs features/todo.feature in gli-2.9.0

- old
+ new

@@ -150,22 +150,23 @@ """ NAME list - List things, such as tasks or contexts SYNOPSIS - todo [global options] list [command options] [--flag arg] [-x arg] [tasks] - todo [global options] list [command options] [--otherflag arg] [-b] [-f|--foobar] contexts + todo [global options] list [command options] [tasks] [--flag arg] [-x arg] + todo [global options] list [command options] contexts [--otherflag arg] [-b] [-f|--foobar] DESCRIPTION List a whole lot of things that you might be keeping track of in your overall todo list. This is your go-to place or finding all of the things that you might have stored in your todo databases. COMMAND OPTIONS - -l, --[no-]long - Show long form + -l, --[no-]long - Show long form + --required_flag=arg - (required, default: none) COMMANDS contexts - List contexts tasks - List tasks (default) """ @@ -196,18 +197,19 @@ """ NAME list - List things, such as tasks or contexts SYNOPSIS - todo [global options] list [command options] [--flag arg] [-x arg] [tasks] - todo [global options] list [command options] [--otherflag arg] [-b] [-f|--foobar] contexts + todo [global options] list [command options] [tasks] [--flag arg] [-x arg] + todo [global options] list [command options] contexts [--otherflag arg] [-b] [-f|--foobar] DESCRIPTION List a whole lot of things that you might be keeping track of in your overall todo list. This is your go-to place or finding all of the things that you might have stored in your todo databases. COMMAND OPTIONS - -l, --[no-]long - Show long form + -l, --[no-]long - Show long form + --required_flag=arg - (required, default: none) COMMANDS contexts - List contexts tasks - List tasks (default) """ @@ -219,12 +221,12 @@ """ NAME list - List things, such as tasks or contexts SYNOPSIS - todo [global options] list [command options] [--flag arg] [-x arg] [tasks] - todo [global options] list [command options] [--otherflag arg] [-b] [-f|--foobar] contexts + todo [global options] list [command options] [tasks] [--flag arg] [-x arg] + todo [global options] list [command options] contexts [--otherflag arg] [-b] [-f|--foobar] DESCRIPTION List a whole lot of things that you might be keeping track of in your overall todo list. @@ -234,11 +236,12 @@ stored in your todo databases. COMMAND OPTIONS - -l, --[no-]long - Show long form + -l, --[no-]long - Show long form + --required_flag=arg - (required, default: none) COMMANDS contexts - List contexts tasks - List tasks (default) """ @@ -250,18 +253,19 @@ """ NAME list - List things, such as tasks or contexts SYNOPSIS - todo [global options] list [command options] [--flag arg] [-x arg] [tasks] - todo [global options] list [command options] [--otherflag arg] [-b] [-f|--foobar] contexts + todo [global options] list [command options] [tasks] [--flag arg] [-x arg] + todo [global options] list [command options] contexts [--otherflag arg] [-b] [-f|--foobar] DESCRIPTION List a whole lot of things that you might be keeping track of in your overall todo list. This is your go-to place or finding all of the things that you might have stored in your todo databases. COMMAND OPTIONS - -l, --[no-]long - Show long form + -l, --[no-]long - Show long form + --required_flag=arg - (required, default: none) COMMANDS contexts - List contexts tasks - List tasks (default) """ @@ -273,11 +277,11 @@ NAME tasks - List tasks SYNOPSIS todo [global options] list tasks [command options] - todo [global options] list tasks [command options] open + todo [global options] list tasks [command options] open DESCRIPTION Lists all of your tasks that you have, in varying orders, and all that stuff. Yes, this is long, but I need a long description. @@ -297,26 +301,26 @@ NAME create - Create a new task or context SYNOPSIS todo [global options] create - todo [global options] create contexts [context_name] - todo [global options] create tasks task_name[, task_name]* + todo [global options] create contexts [context_name] + todo [global options] create tasks task_name[, task_name]* COMMANDS <default> - Makes a new task contexts - Make a new context tasks - Make a new task """ And the output should not contain "COMMAND OPTIONS" Scenario: Running list w/out subcommand performs list tasks by default - When I successfully run `todo list boo yay` + When I successfully run `todo list --required_flag=blah boo yay` Then the output should contain "list tasks: boo,yay" Scenario: Running list w/out subcommand or any arguments performs list tasks by default - When I successfully run `todo list` + When I successfully run `todo list --required_flag=blah` Then the output should contain "list tasks:" Scenario: Running chained commands works When I successfully run `todo chained foo bar` Then the output should contain: @@ -349,12 +353,12 @@ """ NAME ls - LS things, such as tasks or contexts SYNOPSIS - todo [global options] ls [command options] [-b] [-f|--foobar] contexts - todo [global options] ls [command options] [-x arg] tasks + todo [global options] ls [command options] contexts [-b] [-f|--foobar] + todo [global options] ls [command options] tasks [-x arg] DESCRIPTION List a whole lot of things that you might be keeping track of in your overall todo list. @@ -409,5 +413,37 @@ Scenario: Do it again because aruba buffers all output Given a clean home directory And a config file that specifies defaults for some commands with subcommands When I successfully run `todo help list contexts` Then I should see the defaults for 'list contexts' from the config file in the help + + Scenario: A complex SYNOPSIS section gets summarized in terminal mode + Given my terminal is 50 characters wide + And my app is configured for "terminal" synopses + When I run `todo ls` + Then the exit status should not be 0 + And the stderr should contain "error: Command 'ls' requires a subcommand" + And the stdout should contain: + """ + NAME + ls - LS things, such as tasks or contexts + + SYNOPSIS + todo [global options] ls [command options] contexts [subcommand options] + todo [global options] ls [command options] tasks [subcommand options] + """ + + Scenario: We can always use a compact SYNOPSIS + Given my terminal is 500 characters wide + And my app is configured for "compact" synopses + When I run `todo ls` + Then the exit status should not be 0 + And the stderr should contain "error: Command 'ls' requires a subcommand" + And the stdout should contain: + """ + NAME + ls - LS things, such as tasks or contexts + + SYNOPSIS + todo [global options] ls [command options] contexts [subcommand options] + todo [global options] ls [command options] tasks [subcommand options] + """