Skip to content

Commit

Permalink
Merge pull request #40 from Fubinator/fix/#39-correct-name-in-error-m…
Browse files Browse the repository at this point in the history
…essage

Use 'new' instead of 'name' for the argument name in the error message
  • Loading branch information
sebastienrousseau authored Mar 29, 2023
2 parents e9b016f + db62937 commit 294ddcb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub fn args(matches: &ArgMatches) -> Result<(), String> {
Some(name) => name.to_owned(),
None => {
return Err(
"❌ Error: Argument \"name\" is required but missing."
"❌ Error: Argument \"new\" is required but missing."
.to_owned(),
);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/test_args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
// // Assert that the function returns an error message.
// assert_eq!(
// result,
// Err("❌ Error: Argument \"name\" is required but missing."
// Err("❌ Error: Argument \"new\" is required but missing."
// .to_owned())
// );

Expand Down
2 changes: 1 addition & 1 deletion tests/test_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ mod tests {
let result = args(&matches);
assert_eq!(
result,
Err("❌ Error: Argument \"name\" is required but missing."
Err("❌ Error: Argument \"new\" is required but missing."
.to_owned())
);
}
Expand Down

0 comments on commit 294ddcb

Please sign in to comment.