Skip to content

Commit fb5bbfd

Browse files
committed
Update settings_store_tests.cpp
1 parent ea05cab commit fb5bbfd

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

tests/engine/settings_store_tests.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,12 @@ TEST_CASE("AC-019: save_all writes dirty stores and skips clean ones", "[setting
683683
SettingsTestCtx ctx;
684684
auto tmp = temp_dir();
685685

686+
// Pre-create the OS config dir for editor settings so save() can write there
687+
// on all platforms (CI, local). The settings system is designed to create this
688+
// directory — it is a well-known, expected location.
689+
std::filesystem::create_directories(
690+
be::os_user_config_dir());
691+
686692
be::SettingsManager mgr(tmp, ctx.ctx());
687693
auto load_result = mgr.load_all();
688694
REQUIRE(load_result.has_value());
@@ -708,11 +714,13 @@ TEST_CASE("AC-019: save_all writes dirty stores and skips clean ones", "[setting
708714
auto user_node = YAML::LoadFile(user_path.string());
709715
REQUIRE(user_node["key"].as<std::string>() == "user_value");
710716

711-
// Editor settings go to os_user_config_dir() — we don't check the file on disk
712-
// to avoid OS config dir side effects (the save behaviour itself is verified
713-
// by AC-006). Verify editor data in-memory instead.
717+
// Editor settings file exists on disk
718+
auto editor_path = be::os_user_config_dir() / "editor.yaml";
719+
REQUIRE(std::filesystem::exists(editor_path));
720+
721+
// In-memory data preserved, store is clean after save
714722
REQUIRE(mgr.editor_settings().get<std::string>("key", "") == "editor_value");
715-
REQUIRE_FALSE(mgr.editor_settings().is_dirty()); // save() was called, store is clean
723+
REQUIRE_FALSE(mgr.editor_settings().is_dirty());
716724
}
717725

718726
// ═════════════════════════════════════════════════════════════════════════════

0 commit comments

Comments
 (0)