Fix flaky test that assumed no user config exists
The load_with_no_config_files test asserted exactly 1 layer, but a
user config on the host adds a second. Rename to load_with_no_project_config
and only assert the builtin layer is present and no project layer exists.
diff --git a/src/config.rs b/src/config.rs
index 6019e2c..6dde657 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -522,12 +522,13 @@ mod tests {
}
#[test]
- fn load_with_no_config_files() {
+ fn load_with_no_project_config() {
// Use a workspace with no .ramekin/config.kdl
let config = Config::load(Path::new("/tmp"), vec![]).unwrap();
- // Should have only the builtin layer
- assert_eq!(config.layers.len(), 1);
- assert_eq!(config.layers[0].scope, Scope::Builtin);
+ // Builtin layer is always last
+ assert_eq!(config.layers.last().unwrap().scope, Scope::Builtin);
+ // No project layer
+ assert!(!config.layers.iter().any(|l| l.scope == Scope::Project));
}
#[test]
diff --git a/src/main.rs b/src/main.rs
index 1a6b086..d39d66b 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -6,10 +6,10 @@ use std::path::{Path, PathBuf};
use std::process::{Command, Stdio};
use clap::{Parser, Subcommand};
-use color_eyre::eyre::{bail, Context, Result};
+use color_eyre::eyre::{Context, Result, bail};
use serde::Serialize;
use tracing::{error, info};
-use tracing_subscriber::{fmt, prelude::*, EnvFilter};
+use tracing_subscriber::{EnvFilter, fmt, prelude::*};
const DOCKERFILE: &str = include_str!("../assets/Dockerfile");
const RAMEKIN_EXTENSION: &str = include_str!("../assets/ramekin.ts");