diff --git a/src/ops/work_tree.rs b/src/ops/work_tree.rs index f7d1cab..c9d9b1b 100644 --- a/src/ops/work_tree.rs +++ b/src/ops/work_tree.rs @@ -154,7 +154,6 @@ where let result = (*self.function)(&mut self.context, response); let completed = self.results.send(result).is_err(); - self.completed = completed; } } diff --git a/src/ops/workspace.rs b/src/ops/workspace.rs index 7c6bb48..1ce1fb9 100644 --- a/src/ops/workspace.rs +++ b/src/ops/workspace.rs @@ -147,6 +147,7 @@ where "Licensa is already initialized in the current directory", )); } + Ok(()) } pub fn throw_no_workspace_config_exists
(workspace_root: P) -> Result<()>
@@ -266,29 +267,19 @@ mod tests {
#[test]
fn test_write_config_file_successful() {
- // Create a temporary directory for testing
let temp_dir = tempdir().expect("Failed to create temporary directory");
-
- // Define the target directory
let target_dir = temp_dir.path();
-
- // Define the output file path
let config_file_path = target_dir.join(DEFAULT_CONFIG_FILENAME);
- // Create a sample configuration
let sample_config = ExampleWorkspace {
prop1: "hello world".to_string(),
prop2: 1234,
};
- // Test writing the config file
let write_result = save_workspace_config(target_dir, &sample_config);
assert!(write_result.is_ok());
-
- // Verify that the config file exists
assert!(config_file_path.exists());
- // Verify the content of the config file
let mut file = File::open(&config_file_path).expect("Failed to open config file");
let mut file_content = String::new();
file.read_to_string(&mut file_content)
@@ -304,18 +295,12 @@ mod tests {
#[test]
fn test_write_config_file_existing_file() {
- // Create a temporary directory for testing
let temp_dir = tempdir().expect("Failed to create temporary directory");
-
- // Define the target directory
let target_dir = temp_dir.path();
-
- // Create an existing config file in the temporary directory
let existing_config_filename = POSSIBLE_CONFIG_FILENAMES[0];
let existing_config_path = target_dir.join(existing_config_filename);
File::create(&existing_config_path).expect("Failed to create existing config file");
- // Create a sample configuration
let sample_config = ExampleWorkspace {
prop1: "hello world".to_string(),
prop2: 1234,
@@ -332,18 +317,12 @@ mod tests {
#[test]
fn test_find_config_file_single_file_exists() {
- // Create a temporary directory for testing
let temp_dir = tempdir().expect("Failed to create temporary directory");
-
- // Define the target directory
let target_dir = temp_dir.path();
-
- // Create a sample config file in the temporary directory
let sample_config_filename = POSSIBLE_CONFIG_FILENAMES[0];
let sample_config_path = target_dir.join(sample_config_filename);
File::create(&sample_config_path).expect("Failed to create sample config file");
- // Test finding the config file
let result: Result