New architecture
This commit is contained in:
parent
e4b3424ba6
commit
907a4962c5
61 changed files with 2742 additions and 3100 deletions
|
|
@ -2,7 +2,7 @@ use schematics::symbols::file::File as FileSymbol;
|
|||
use schematics::symbols::Symbol;
|
||||
use std::fs::File;
|
||||
use std::io::Write;
|
||||
use std::path::Path;
|
||||
use std::path::{Path, PathBuf};
|
||||
use tempdir::TempDir;
|
||||
|
||||
fn get_dir(content: Option<&str>) -> TempDir {
|
||||
|
|
@ -18,11 +18,8 @@ fn get_dir(content: Option<&str>) -> TempDir {
|
|||
tmp_dir
|
||||
}
|
||||
|
||||
fn get_symbol(path: &Path) -> FileSymbol<&str, String> {
|
||||
FileSymbol::new(
|
||||
String::from(path.join("filename").to_str().unwrap()),
|
||||
"target content",
|
||||
)
|
||||
fn get_symbol(path: &Path) -> FileSymbol<PathBuf, &str> {
|
||||
FileSymbol::new(path.join("filename"), "target content")
|
||||
}
|
||||
|
||||
// Normal cases
|
||||
|
|
@ -81,7 +78,7 @@ fn no_file() {
|
|||
|
||||
#[test]
|
||||
fn may_not_read_file() {
|
||||
let symbol = get_symbol(&Path::new("/etc/passwd"));
|
||||
let symbol = get_symbol(&Path::new("/etc/shadow"));
|
||||
|
||||
assert_eq!(symbol.target_reached().is_err(), true);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue