refactor: remove closure from create_test_items in test_save_item
This commit is contained in:
committed by
Andrew Phillips (aider)
parent
7490be8e42
commit
c34d7ccf4d
23
src/tests.rs
23
src/tests.rs
@@ -74,20 +74,19 @@ mod tests {
|
|||||||
fn test_save_item() {
|
fn test_save_item() {
|
||||||
with_temp_env(|data_dir| {
|
with_temp_env(|data_dir| {
|
||||||
// Create test items with the common environment setup
|
// Create test items with the common environment setup
|
||||||
create_test_items(data_dir, |input, tag| {
|
create_test_items(data_dir);
|
||||||
// Set the data directory for this test
|
// Set the data directory for this test
|
||||||
let env = format!("KEEP_DIR={} cargo run --", data_dir.display());
|
let env = format!("KEEP_DIR={} cargo run --", data_dir.display());
|
||||||
|
|
||||||
// Create a command that pipes input to keep with the specified environment
|
// Create a command that pipes input to keep with the specified environment
|
||||||
let cmd = format!("echo {} | {} {}", input, env, tag);
|
let cmd = format!("echo {} | {} {}", input, env, tag);
|
||||||
let output = run_sh(cmd.as_str());
|
let output = run_sh(cmd.as_str());
|
||||||
assert!(
|
assert!(
|
||||||
output.status.success(),
|
output.status.success(),
|
||||||
"Command failed: {} RC={}",
|
"Command failed: {} RC={}",
|
||||||
cmd,
|
cmd,
|
||||||
output.status
|
output.status
|
||||||
);
|
);
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user