mirror of
https://github.com/floci-io/floci-cli.git
synced 2026-11-22 21:50:47 -05:00
feat(profile): warn when a profile sets a key floci does not read (#37)
This commit is contained in:
1 parent
01d6133548
commit
22668a1200
7 files changed
+125
No files matched your search
@@ -89,6 +89,23 @@ class MissingProfileTest {
|
||||
assertTrue(out.toString().contains("enforced"), out.toString()); // help wraps the image value
|
||||
}
|
||||
|
||||
/** BL-013: a misspelled key is still ignored, but no longer silently. */
|
||||
@Test
|
||||
void aMisspelledKeyIsReportedOnceAndTheProfileStillApplies() throws Exception {
|
||||
writeProfile("typo-key", "container: floci-typo\npersist_dir: /data\n");
|
||||
|
||||
int[] exit = new int[1];
|
||||
String err = captureStderr(() -> {
|
||||
cli().parseArgs("start", "--profile", "typo-key");
|
||||
return 0;
|
||||
}, exit);
|
||||
|
||||
assertEquals(0, exit[0]);
|
||||
assertTrue(err.contains("Profile 'typo-key' sets 'persist_dir'"), err);
|
||||
assertTrue(err.contains("persistDir"), err);
|
||||
assertEquals(1, err.split("Warning").length - 1, err);
|
||||
}
|
||||
|
||||
@Test
|
||||
void helpStillWorksWithABadProfile() {
|
||||
int[] exit = new int[1];
|
||||
|
||||
Reference in new issue
Block a user