File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed
Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change 11use assert_cmd:: Command ;
2- use predicates:: str:: is_match;
2+ use predicates:: str:: { is_empty , is_match, starts_with } ;
33
44#[ test]
55fn test_version_subcommand ( ) {
@@ -12,5 +12,22 @@ fn test_version_subcommand() {
1212 // Assert
1313 assertion
1414 . success ( )
15- . stdout ( is_match ( "^cotp \\ d+\\ .\\ d+\\ .\\ d+-DEBUG-.+" ) . unwrap ( ) ) ;
15+ . stdout ( is_match ( "^cotp \\ d+\\ .\\ d+\\ .\\ d+-DEBUG-.+" ) . unwrap ( ) )
16+ . stderr ( is_empty ( ) ) ;
17+ }
18+
19+ #[ test]
20+ fn test_help_subcommand ( ) {
21+ // Arrange / Act
22+ let assertion = Command :: cargo_bin ( "cotp" ) . unwrap ( ) . arg ( "--help" ) . assert ( ) ;
23+
24+ // Assert
25+ assertion
26+ . success ( )
27+ . stdout ( starts_with (
28+ "Trustworthy, encrypted, command-line TOTP/HOTP authenticator app with import functionality.
29+
30+ Usage: cotp [OPTIONS] [COMMAND]" ,
31+ ) )
32+ . stderr ( is_empty ( ) ) ;
1633}
You can’t perform that action at this time.
0 commit comments