mirror of
https://github.com/clap-rs/clap
synced 2024-11-10 23:04:23 +00:00
tests: adds test to check for before_help
This commit is contained in:
parent
b3faff6030
commit
24423e661e
1 changed files with 24 additions and 0 deletions
|
@ -36,6 +36,20 @@ SUBCOMMANDS:
|
|||
help Prints this message or the help of the given subcommand(s)
|
||||
subcmd tests subcommands";
|
||||
|
||||
static AFTER_HELP: &'static str = "some text that comes before the help
|
||||
|
||||
clap-test v1.4.8
|
||||
tests clap library
|
||||
|
||||
USAGE:
|
||||
clap-test [FLAGS]
|
||||
|
||||
FLAGS:
|
||||
-h, --help Prints help information
|
||||
-V, --version Prints version information
|
||||
|
||||
some text that comes after the help";
|
||||
|
||||
static SC_HELP: &'static str = "subcmd 0.1
|
||||
Kevin K. <kbknapp@gmail.com>
|
||||
tests subcommands
|
||||
|
@ -135,6 +149,16 @@ fn complex_help_output() {
|
|||
test::check_help(test::complex_app(), HELP);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn after_and_before_help_output() {
|
||||
let app = App::new("clap-test")
|
||||
.version("v1.4.8")
|
||||
.about("tests clap library")
|
||||
.before_help("some text that comes before the help")
|
||||
.after_help("some text that comes after the help");
|
||||
test::check_help(app, AFTER_HELP);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn complex_subcommand_help_output() {
|
||||
let mut a = test::complex_app();
|
||||
|
|
Loading…
Reference in a new issue