Skip to content

Commit

Permalink
tests: minor test improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinatorul committed Sep 28, 2015
1 parent af8bfb1 commit e102c1b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/groups.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
extern crate clap;

use clap::{App, ArgGroup};
use clap::{App, ArgGroup, ClapErrorType};

#[test]
fn required_group_missing_arg() {
let m = App::new("group")
let result = App::new("group")
.args_from_usage("-f, --flag 'some flag'
-c, --color 'some other flag'")
.arg_group(ArgGroup::with_name("req")
.add_all(&["flag", "color"])
.required(true))
.get_matches_from_safe(vec![""]);
assert!(m.is_err());
assert!(result.is_err());
let err = result.err().unwrap();
assert_eq!(err.error_type, ClapErrorType::MissingRequiredArgument);
}

#[test]
Expand Down

0 comments on commit e102c1b

Please sign in to comment.