|
@ -2,10 +2,10 @@ use regex::Regex; |
|
|
use schematics::storage::{SimpleStorage, Storage};
|
|
|
use schematics::storage::{SimpleStorage, Storage};
|
|
|
use std::fs::{create_dir, File};
|
|
|
use std::fs::{create_dir, File};
|
|
|
use std::path::Path;
|
|
|
use std::path::Path;
|
|
|
use tempdir::TempDir;
|
|
|
|
|
|
|
|
|
use tempfile::{tempdir, TempDir};
|
|
|
|
|
|
|
|
|
fn get_dir<'a, I: IntoIterator<Item = &'a &'a str>>(content: I) -> TempDir {
|
|
|
fn get_dir<'a, I: IntoIterator<Item = &'a &'a str>>(content: I) -> TempDir {
|
|
|
let tmp_dir = TempDir::new("unittest").expect("create temp dir");
|
|
|
|
|
|
|
|
|
let tmp_dir = tempdir().expect("create temp dir");
|
|
|
let storage_path = tmp_dir.path().join("_filename");
|
|
|
let storage_path = tmp_dir.path().join("_filename");
|
|
|
create_dir(storage_path.clone()).unwrap();
|
|
|
create_dir(storage_path.clone()).unwrap();
|
|
|
for path in content {
|
|
|
for path in content {
|
|
@ -93,7 +93,7 @@ fn three_files() { |
|
|
|
|
|
|
|
|
#[test]
|
|
|
#[test]
|
|
|
fn empty_storage() {
|
|
|
fn empty_storage() {
|
|
|
let dir = TempDir::new("unittest").expect("create temp dir");
|
|
|
|
|
|
|
|
|
let dir = tempdir().expect("create temp dir");
|
|
|
let storage = get_storage(dir.path());
|
|
|
let storage = get_storage(dir.path());
|
|
|
|
|
|
|
|
|
assert!(
|
|
|
assert!(
|
|
|