features/todo.feature in gli-2.10.0 vs features/todo.feature in gli-2.11.0

- old
+ new

@@ -15,10 +15,11 @@ error: Unknown command 'unknown'. Use 'todo help' for a list of commands. """ Scenario Outline: Getting Help for todo in general When I successfully run `todo <help>` + Then the exit status should be 0 Then the output should contain: """ NAME todo - Manages tasks @@ -193,12 +194,13 @@ 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 - --required_flag=arg - (required, default: none) + -l, --[no-]long - Show long form + --required_flag=arg - (required, default: none) + --required_flag2=arg - (required, default: none) COMMANDS contexts - List contexts tasks - List tasks (default) """ @@ -236,12 +238,13 @@ 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 - --required_flag=arg - (required, default: none) + -l, --[no-]long - Show long form + --required_flag=arg - (required, default: none) + --required_flag2=arg - (required, default: none) COMMANDS contexts - List contexts tasks - List tasks (default) """ @@ -268,12 +271,13 @@ stored in your todo databases. COMMAND OPTIONS - -l, --[no-]long - Show long form - --required_flag=arg - (required, default: none) + -l, --[no-]long - Show long form + --required_flag=arg - (required, default: none) + --required_flag2=arg - (required, default: none) COMMANDS contexts - List contexts tasks - List tasks (default) """ @@ -292,12 +296,13 @@ 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 - --required_flag=arg - (required, default: none) + -l, --[no-]long - Show long form + --required_flag=arg - (required, default: none) + --required_flag2=arg - (required, default: none) COMMANDS contexts - List contexts tasks - List tasks (default) """ @@ -334,25 +339,31 @@ create - Create a new task or context SYNOPSIS todo [global options] create todo [global options] create contexts [context_name] + todo [global options] create relation_1-1 first second [name] + todo [global options] create relation_1-n first second[, second]* [name] + todo [global options] create relation_n-1 first[, first]* second [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 + <default> - Makes a new task + contexts - Make a new context + relation_1-1 - + relation_1-n - + relation_n-1 - + 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 --required_flag=blah boo yay` + When I successfully run `todo list --required_flag=blah --required_flag2=bleh 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 --required_flag=blah` + When I successfully run `todo list --required_flag=blah --required_flag2=bleh` 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: @@ -477,5 +488,59 @@ SYNOPSIS todo [global options] ls [command options] contexts [subcommand options] todo [global options] ls [command options] tasks [subcommand options] """ + + Scenario: We get a clear error message when a required argument is missing + Given a clean home directory + When I run `todo list` + Then the exit status should not be 0 + And the stderr should contain "error: required_flag is required, required_flag2 is required" + And the output should contain: + """ + NAME + list - List things, such as tasks or contexts + + SYNOPSIS + todo [global options] list [command options] [tasks] [subcommand options] + todo [global options] list [command options] contexts [subcommand options] + + 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 + --required_flag=arg - (required, default: none) + --required_flag2=arg - (required, default: none) + + COMMANDS + contexts - List contexts + tasks - List tasks (default) + """ + + Scenario: Getting help on a root command with an arg_name outputs the argument description + When I run `todo help first` + And the stdout should contain: + """ + NAME + first - + + SYNOPSIS + todo [global options] first [argument] + """ + + Scenario: Getting help on a root command with an arg outputs the argument description + When I run `todo help second` + And the stdout should contain: + """ + NAME + second - + + SYNOPSIS + todo [global options] second [argument] + """ +