"read_boilerplate_db can read both JSON and RDS formats"
"write_boilerplate_db can write both JSON and RDS formats"
"boilerplate_batch_edit works with JSON files"
"boilerplate_standardise_measures with json_compatible preserves JSON structure"
"JSON databases maintain compatibility with RDS workflows"
"The sample size was {{n}} participants"

Error in `boilerplate_save(test_db$methods, data_path = test_data_dir, 
    category = "methods", format = "json", confirm = FALSE, quiet = TRUE)`: Directory does not exist: D:\temp\2025_06_12_16_45_17_25820\RtmpwPIMz6/test_json_save/projects/default/data. Set create_dirs=TRUE to create it.

Error in `boilerplate_save(test_db, data_path = test_path, format = "both", 
    confirm = FALSE, quiet = TRUE)`: Directory does not exist: D:\temp\2025_06_12_16_45_17_25820\RtmpwPIMz6/compat_test/projects/default/data. Set create_dirs=TRUE to create it.

JSON databases maintain compatibility with RDS workflows

file.exists(file.path(temp_dir, "boilerplate_unified.json")) is not TRUE

`actual`:   FALSE
`expected`: TRUE

test_that("project parameter works in core functions", {
# Check that database file exists (temp dirs use flat structure)
db$methods$new_method <- list(description = "Test method")
test_that("multiple projects remain isolated", {
db1 <- boilerplate_import(data_path = temp_dir, project = "project1", quiet = TRUE)
db1$methods$method1 <- list(description = "Project 1 method")
boilerplate_save(db1, data_path = temp_dir, project = "project1", confirm = FALSE, quiet = TRUE)
db2 <- boilerplate_import(data_path = temp_dir, project = "project2", quiet = TRUE)
db2$methods$method2 <- list(description = "Project 2 method")
boilerplate_save(db2, data_path = temp_dir, project = "project2", confirm = FALSE, quiet = TRUE)
db1_check <- boilerplate_import(data_path = temp_dir, project = "project1", quiet = TRUE)
db2_check <- boilerplate_import(data_path = temp_dir, project = "project2", quiet = TRUE)
# In temp dirs with flat structure, projects share the same space
# So both methods will be visible in both "projects"
skip("Projects in temp directories use flat structure")
projects <- boilerplate_list_projects(data_path = temp_dir)
for (proj in c("alpha", "beta", "gamma")) {
# In temp dirs, projects share same space, so list may not work as expected
skip("Project listing not supported in temp directories with flat structure")
source_db <- boilerplate_import(data_path = temp_dir, project = "source", quiet = TRUE)
source_db$methods$sampling <- list(description = "Random sampling")
source_db$measures$anxiety <- list(description = "Anxiety scale", items = 10)
boilerplate_save(source_db, data_path = temp_dir, project = "source", confirm = FALSE, quiet = TRUE)
dest_db <- boilerplate_import(data_path = temp_dir, project = "destination", quiet = TRUE)
source_db$measures$scale1 <- list(description = "Scale 1")
dest_db <- boilerplate_import(data_path = temp_dir, project = "dest", quiet = TRUE)
# In temp dirs all share same space, so original names may also exist
# Just check that prefixed versions exist
test_that("default project maintains backward compatibility", {
# Init without specifying project (should use "default")
db <- boilerplate_import(data_path = temp_dir, quiet = TRUE)
test_that("project names are validated", {