This repository has been archived by the owner on Nov 11, 2017. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check for more edge cases when parsing options and display help when …
…requested or options are invalid
- Loading branch information
Showing
3 changed files
with
144 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
Feature: get help on using trout | ||
|
||
Scenario Outline: Specify an unknown command | ||
When I run "trout <arguments>" | ||
Then the output should contain: | ||
""" | ||
I don't know how to "<command>." | ||
Run "trout help" for usage information. | ||
""" | ||
Examples: | ||
| arguments | command | | ||
| swim | swim | | ||
| help swim | swim | | ||
|
||
Scenario Outline: Run an invalid command | ||
When I run "<invalid command>" | ||
Then the output should contain: | ||
""" | ||
I don't understand the options you provided. | ||
Run "<help command>" for usage information. | ||
""" | ||
Examples: | ||
| invalid command | help command | | ||
| trout checkout | trout help checkout | | ||
| trout checkout file | trout help checkout | | ||
| trout checkout file url extra | trout help checkout | | ||
| trout update | trout help update | | ||
| trout update file extra | trout help update | | ||
|
||
Scenario Outline: Ask for help | ||
When I run "<help command>" | ||
Then the output should contain: | ||
""" | ||
trout helps you sync individual files from other git repositories. | ||
""" | ||
And the output should contain: | ||
""" | ||
Commands: | ||
""" | ||
And the output should not contain: | ||
""" | ||
I don't know how | ||
""" | ||
Examples: | ||
| help command | | ||
| trout | | ||
| trout help | | ||
| trout -h | | ||
| trout --help | | ||
|
||
Scenario Outline: Ask for usage for a particular command | ||
When I run "trout help <command>" | ||
Then the output should contain: | ||
""" | ||
Usage: trout <command> <usage> | ||
""" | ||
Examples: | ||
| command | usage | | ||
| checkout | filename git_url | | ||
| update | filename | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,3 +78,4 @@ Feature: sync a Gemfile between two repositories | |
gem "mysql" | ||
gem "redcloth" | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters