summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNora <nora.widdecke@tu-bs.de>2019-01-22 20:57:03 +0100
committerNora <nora.widdecke@tu-bs.de>2019-01-22 20:57:03 +0100
commit489ec195efefb58f2a1ee4779ff1ebead4f3fc33 (patch)
tree11569ecb33f4edff391bd15c3ea137f7a55de5df
parent1b81055f77730672e0e2857bb727ac462284654d (diff)
copy: also test content
-rw-r--r--src/actions/copy.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/actions/copy.rs b/src/actions/copy.rs
index 00b2245..e8cd4fa 100644
--- a/src/actions/copy.rs
+++ b/src/actions/copy.rs
@@ -1,5 +1,4 @@
use input;
-use khline::KhLine;
use utils::fileutil;
use utils::misc;
@@ -24,20 +23,23 @@ pub fn do_copy(_args: &[&str]) -> KhResult<()> {
mod tests {
use super::*;
- use testutils::prepare_testdir;
use assert_fs::prelude::*;
- use predicates::prelude::*;
+ use khline::KhLine;
+ use testutils::prepare_testdir;
use utils::stdioutils;
+ use predicates::prelude::*;
#[test]
fn copy_test() {
let testdir = prepare_testdir("testdir");
-
stdioutils::test_stdin_write("twodaysacrossbuckets.ics");
do_copy(&[]).unwrap();
let child = testdir.child(".khaleesi/cal/11111111-2222-3333-4444-444444444444@khaleesi.ics");
child.assert(predicate::path::exists());
+
+ let khline = "11111111-2222-3333-4444-444444444444@khaleesi.ics".parse::<KhLine>().unwrap();
+ assert_eq!("11111111-2222-3333-4444-444444444444@khaleesi", khline.to_event().unwrap().get_uid());
}
}