0.0.2-alpha.2.fix.1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// file: crates/knowledge-git-lib/unit_tests/backend.rs
|
||||
// version: 1
|
||||
// version: 2
|
||||
|
||||
#[derive(Clone)]
|
||||
struct RecordingRunner {
|
||||
@@ -41,9 +41,7 @@ impl super::GitCommandRunner for RecordingRunner {
|
||||
return Err(error);
|
||||
}
|
||||
if specification.operation == crate::GitOperation::InspectMirror {
|
||||
return Ok(super::GitCommandOutput {
|
||||
stdout: self.inspection_stdout.clone(),
|
||||
});
|
||||
return Ok(super::GitCommandOutput { stdout: self.inspection_stdout.clone() });
|
||||
}
|
||||
return Ok(super::GitCommandOutput { stdout: Vec::new() });
|
||||
}
|
||||
@@ -180,10 +178,7 @@ fn process_errors_do_not_expose_remote_location_or_credentials() {
|
||||
Ok(value) => value,
|
||||
Err(_) => return,
|
||||
};
|
||||
let runner = RecordingRunner::failing(crate::GitBackendError::GitCommandFailed {
|
||||
operation: crate::GitOperation::CloneMirror,
|
||||
exit_code: Some(128),
|
||||
});
|
||||
let runner = RecordingRunner::failing(crate::GitBackendError::GitCommandFailed { operation: crate::GitOperation::CloneMirror, exit_code: Some(128) });
|
||||
let backend = crate::GitBackend::with_runner(config, Box::new(runner));
|
||||
let source_id_result = source_id("snippets");
|
||||
assert!(source_id_result.is_some());
|
||||
@@ -206,13 +201,7 @@ fn process_errors_do_not_expose_remote_location_or_credentials() {
|
||||
let display = error.to_string();
|
||||
assert!(!display.contains("secret"));
|
||||
assert!(!display.contains("example.invalid"));
|
||||
assert_eq!(
|
||||
error,
|
||||
crate::GitBackendError::GitCommandFailed {
|
||||
operation: crate::GitOperation::CloneMirror,
|
||||
exit_code: Some(128),
|
||||
}
|
||||
);
|
||||
assert_eq!(error, crate::GitBackendError::GitCommandFailed { operation: crate::GitOperation::CloneMirror, exit_code: Some(128) });
|
||||
let _ = std::fs::remove_dir_all(root);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user