-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: improve error msg when adding coauthor with invalid key
Remove suggestion to use initials for keys since first names might be a better option for some
- Loading branch information
Showing
5 changed files
with
28 additions
and
6 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 |
---|---|---|
|
@@ -46,7 +46,7 @@ $ cargo install git-mob-tool | |
|
||
## Configuration | ||
|
||
- Store your team members' details with keys (usually initials) | ||
- Store your team members' details with keys | ||
|
||
```console | ||
$ git mob coauthor --add lm "Leo Messi" [email protected] | ||
|
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
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
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 |
---|---|---|
|
@@ -50,6 +50,27 @@ fn test_add_and_list_coauthors(ctx: TestContextCli) -> Result<(), Box<dyn Error> | |
Ok(()) | ||
} | ||
|
||
#[test_context(TestContextCli, skip_teardown)] | ||
#[test] | ||
fn test_add_coauthor_with_invalid_key(ctx: TestContextCli) -> Result<(), Box<dyn Error>> { | ||
ctx.git() | ||
.args([ | ||
"mob", | ||
"coauthor", | ||
"--add", | ||
"invalid_key_with_underscore", | ||
"Leo Messi", | ||
"[email protected]", | ||
]) | ||
.assert() | ||
.failure() | ||
.stderr(predicate::str::diff( | ||
"Error: \"Invalid key: invalid_key_with_underscore\"\n", | ||
)); | ||
|
||
Ok(()) | ||
} | ||
|
||
#[test_context(TestContextCli, skip_teardown)] | ||
#[test] | ||
fn test_list_coauthors_given_no_coauthors_added(ctx: TestContextCli) -> Result<(), Box<dyn Error>> { | ||
|
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