summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/src/imag.rs9
-rw-r--r--tests/ui/src/imag_create.rs2
2 files changed, 10 insertions, 1 deletions
diff --git a/tests/ui/src/imag.rs b/tests/ui/src/imag.rs
index 3c517ce2..34edbb4c 100644
--- a/tests/ui/src/imag.rs
+++ b/tests/ui/src/imag.rs
@@ -55,7 +55,16 @@ pub fn stdout_of_command(mut command: Command) -> Vec<String> {
/// Create a PathBuf for a file in a TempDir
pub fn file_path(tempdir: &TempDir, path_elements: &[&str]) -> PathBuf {
+ create_path_for(tempdir.path().to_path_buf(), path_elements)
+}
+
+pub fn store_path(tempdir: &TempDir, path_elements: &[&str]) -> PathBuf {
let mut path = tempdir.path().to_path_buf();
+ path.push("store");
+ create_path_for(path, path_elements)
+}
+
+fn create_path_for(mut path: PathBuf, path_elements: &[&str]) -> PathBuf {
path_elements.iter().for_each(|el| path.push(el));
debug!("Calculated path = {:?}", path);
path
diff --git a/tests/ui/src/imag_create.rs b/tests/ui/src/imag_create.rs
index a857ed28..993ba366 100644
--- a/tests/ui/src/imag_create.rs
+++ b/tests/ui/src/imag_create.rs
@@ -50,7 +50,7 @@ fn test_creating_works() {
call(&imag_home, &["test"]);
- let entry_path = crate::imag::file_path(&imag_home, &["store", "test"]);
+ let entry_path = crate::imag::store_path(&imag_home, &["test"]);
assert!(entry_path.exists(), "Entry was not created: {:?}", entry_path);
assert!(entry_path.is_file() , "Entry is not a file: {:?}", entry_path);