This commit is contained in:
nora 2024-01-31 21:18:43 +01:00
parent fb5208f734
commit d964157bfc
14 changed files with 900 additions and 1 deletions

27
tests/init.rs Normal file
View file

@ -0,0 +1,27 @@
mod helpers;
use helpers::*;
#[test]
fn init() {
let dir = tmpdir();
run_in(&dir, ["init"]).unwrap();
assert!(dir.path().join(".fuf").is_dir());
assert!(dir.path().join(".fuf").join("db").is_dir());
assert!(dir.path().join(".fuf").join("db").join("objects").is_dir());
}
#[test]
fn double_init() {
let dir = tmpdir();
run_in(&dir, ["init"]).unwrap();
assert!(dir.path().join(".fuf").is_dir());
assert!(dir.path().join(".fuf").join("db").is_dir());
assert!(dir.path().join(".fuf").join("db").join("objects").is_dir());
assert!(run_in(&dir, ["init"]).is_err());
}