diff options
author | Nora <nora.widdecke@tu-bs.de> | 2019-02-25 17:06:23 +0100 |
---|---|---|
committer | Nora <nora.widdecke@tu-bs.de> | 2019-02-25 17:06:23 +0100 |
commit | 772d5e314c8b3523a85cd07b427b4f458580f232 (patch) | |
tree | 1a5617246c5436fc4c08c2c9964a1b1ed7b5e7b3 | |
parent | be50c6e57e3e2e3313eb2fbbc20bb0080536c91e (diff) |
modify
-rw-r--r-- | src/actions/modify.rs | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/src/actions/modify.rs b/src/actions/modify.rs index b217890..8ce75a8 100644 --- a/src/actions/modify.rs +++ b/src/actions/modify.rs @@ -40,12 +40,19 @@ mod integration { use assert_fs::prelude::*; use predicates::prelude::*; + use crate::cli::CommandLine; + use crate::cli::ModifyArgs; + use crate::cli::Command::Modify; + use structopt::StructOpt; + #[test] fn test_do_modify() { let testdir = prepare_testdir("testdir_with_xlicerror"); - let args = ["removeprop", "xlicerror"]; - do_modify(&args).unwrap(); + let args = CommandLine::from_iter(&["khaleesi", "modify", "remove-xlicerror"]); + if let Modify(x) = args.cmd { + do_modify(&x).unwrap(); + } let expected = indoc!( " @@ -76,9 +83,11 @@ mod integration { #[test] fn test_do_modify_dry_run() { let testdir = prepare_testdir("testdir_with_xlicerror"); - let args = ["removeprop", "xlicerror", "--dry-run"]; - do_modify(&args).unwrap(); + let args = CommandLine::from_iter(&["khaleesi", "modify", "--dry-run", "remove-xlicerror"]); + if let Modify(x) = args.cmd { + do_modify(&x).unwrap(); + } let expected = indoc!(" BEGIN:VCALENDAR @@ -104,10 +113,12 @@ mod integration { .assert(predicate); } - #[test] - fn test_do_modify_negative() { - let args = ["nonsense"]; - - assert!(do_modify(&args).is_ok()); - } +// #[test] +// fn test_do_modify_negative() { +// +// let args = CommandLine::from_iter(&["khaleesi", "modify", "nonsense"]); +// if let Modify(x) = args.cmd { +// assert!(do_modify(&x).is_ok()); +// } +// } } |