diff options
author | Vincent Breitmoser <look@my.amazin.horse> | 2019-01-12 18:03:01 +0100 |
---|---|---|
committer | Vincent Breitmoser <look@my.amazin.horse> | 2019-01-12 18:11:27 +0100 |
commit | d090a8e6e3615d33a756a2582aa49919e8f9a8b1 (patch) | |
tree | 545c96656252de500fde769db5b44f9b5e663e4e /src/testutils.rs | |
parent | 7ebfff7a1f7a4516fdd88282c44bf11e255ac9c0 (diff) |
khline: add some more tests
Diffstat (limited to 'src/testutils.rs')
-rw-r--r-- | src/testutils.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/testutils.rs b/src/testutils.rs index 5e56130..72c5f67 100644 --- a/src/testutils.rs +++ b/src/testutils.rs @@ -8,9 +8,14 @@ pub fn path_to(artifact: &str) -> PathBuf { [env!("CARGO_MANIFEST_DIR"), "testdata", artifact].iter().collect() } -pub fn prepare_testdir(template: &str) -> TempDir { +pub fn prepare_testdir_empty() -> TempDir { let testdir = TempDir::new().unwrap(); defaults::set_khaleesi_dir(testdir.path()); + testdir +} + +pub fn prepare_testdir(template: &str) -> TempDir { + let testdir = prepare_testdir_empty(); testdir.child(".khaleesi/").copy_from(path_to(template), &["*"]).unwrap(); testdir } |