test: red for show's no-project refusal blaming the id (#300 fieldtest)
Outside any project, show_process/show_campaign print 'not found in the project store' — asserting a store that does not exist and blaming the id, where the sibling verbs (campaign_runs, validate) degrade honestly naming the missing Aura.toml. The in-process RED pins: the refusal stays Err, its prose names 'no Aura.toml found up from', and does NOT claim 'not found in the project store'. Diagnosed cause: both show fns lack the env.provenance().is_none() guard their siblings use, so the no-project fallback store's Ok(None) masquerades as an unregistered id. refs #304
This commit is contained in:
@@ -752,4 +752,31 @@ mod tests {
|
||||
);
|
||||
assert!(!prose.contains("CostInstrumentKeys"), "Debug leak: {prose}");
|
||||
}
|
||||
|
||||
/// #300 fieldtest (df_4): outside a project (no Aura.toml → `Env::std()`),
|
||||
/// show's refusal names the missing project — the honest degradation
|
||||
/// `validate` and `campaign runs` already share ("no Aura.toml found up
|
||||
/// from <cwd>") — never a "project store" that does not exist. Blaming the
|
||||
/// id sends an author in the wrong directory chasing a registration that
|
||||
/// was never the problem. The refusal itself (Err → exit 1) is correct
|
||||
/// and stays.
|
||||
#[test]
|
||||
fn show_outside_a_project_names_the_missing_aura_toml_not_the_id() {
|
||||
let env = Env::std();
|
||||
for (verb, result) in [
|
||||
("process show", show_process("deadbeef", &env)),
|
||||
("campaign show", show_campaign("deadbeef", &env)),
|
||||
] {
|
||||
let msg = result.expect_err("show outside a project must refuse");
|
||||
assert!(
|
||||
msg.contains("no Aura.toml found up from"),
|
||||
"{verb} outside a project must name the missing Aura.toml: {msg}"
|
||||
);
|
||||
assert!(
|
||||
!msg.contains("not found in the project store"),
|
||||
"{verb} outside a project must not blame the id against a \
|
||||
store that does not exist: {msg}"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user