Get the test to failing,,, correctly
This commit is contained in:
parent
6ac9308a03
commit
c8e63d76a4
7 changed files with 68 additions and 34 deletions
|
@ -1,12 +1,15 @@
|
|||
mod assertions;
|
||||
mod marked_text;
|
||||
|
||||
use git2;
|
||||
use std::path::{Path, PathBuf};
|
||||
use tempdir::TempDir;
|
||||
|
||||
pub use assertions::*;
|
||||
pub use marked_text::*;
|
||||
|
||||
use crate::DOT_GIT;
|
||||
|
||||
pub fn temp_tree(tree: serde_json::Value) -> TempDir {
|
||||
let dir = TempDir::new("").unwrap();
|
||||
write_tree(dir.path(), tree);
|
||||
|
@ -24,6 +27,11 @@ fn write_tree(path: &Path, tree: serde_json::Value) {
|
|||
match contents {
|
||||
Value::Object(_) => {
|
||||
fs::create_dir(&path).unwrap();
|
||||
|
||||
if path.file_name() == Some(&DOT_GIT) {
|
||||
git2::Repository::init(&path.parent().unwrap()).unwrap();
|
||||
}
|
||||
|
||||
write_tree(&path, contents);
|
||||
}
|
||||
Value::Null => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue