tests: adds test to check for before_help

This commit is contained in:
Kevin K 2016-05-30 06:01:00 -04:00
parent b3faff6030
commit 24423e661e

View file

@ -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();