test(profile): pin profile precedence, config show output and bad-profile exits (#38)

This commit is contained in:
Hector Ventura authored and GitHub committed 2026-10-08 23:12:40 -05:00
1 parent 22668a1200
commit af3d7814b9
3 files changed
+109 -1

No files matched your search

@@ -106,6 +106,25 @@ class MissingProfileTest {
assertEquals(1, err.split("Warning").length - 1, err);
}
/** BL-017: -V takes the same bail-out as --help, so a bad profile cannot break it. */
@Test
void versionStillWorksWithABadProfile() {
int[] exit = new int[1];
captureStderr(() -> cli().execute("start", "--profile", "typo", "-V"), exit);
assertEquals(0, exit[0]);
}
/** BL-017: config show used to warn and exit 0 for a missing profile; it exits 2 like every command. */
@Test
void configShowWithAMissingProfileExitsTwo() {
int[] exit = new int[1];
String err = captureStderr(() -> cli().execute("config", "show", "--profile", "missing"), exit);
assertEquals(2, exit[0]);
assertTrue(err.contains("Profile 'missing' not found"), err);
}
@Test
void helpStillWorksWithABadProfile() {
int[] exit = new int[1];