tests(add): introduce basics tests for add
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
use nextsync::config::config::Config;
|
||||
use std::fs::OpenOptions;
|
||||
use rand::{distributions::Alphanumeric, Rng};
|
||||
use std::env;
|
||||
use std::fs::{self, File};
|
||||
@@ -125,6 +126,18 @@ impl ClientTest {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn add_ignore_rule(&self, rule: &str) {
|
||||
let mut nsignore_path = self.volume.clone();
|
||||
nsignore_path.push_str("/.nsignore");
|
||||
let mut file = OpenOptions::new()
|
||||
.write(true)
|
||||
.create(true)
|
||||
.append(true)
|
||||
.open(nsignore_path).unwrap();
|
||||
|
||||
let _ = writeln!(file, "{rule}").unwrap();
|
||||
}
|
||||
|
||||
// pub fn has_file(&mut self, file: &str, content: &str) -> bool {
|
||||
// let full_path = PathBuf::from(self.volume.clone()).join(file);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user