Phase C4 executor 의 마지막 `fix(test): clippy + fmt fixes` commit 이 test file 부분만 fmt 적용. workspace 전체 fmt 누락 발견 → cargo fmt --all 적용. 모든 import alphabetical reorder + line wrapping 정합. 추가 untracked artifact 동시 commit: - docs/superpowers/specs/2026-05-28-v0.20-ingest-log-spec.md (491 line, ACCEPT) - docs/superpowers/plans/2026-05-28-v0.20-ingest-log-plan.md (616 line, ACCEPT) workspace test: 1370 passed / 0 failed / 50 ignored, ingest_log_smoke green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
34 lines
1.5 KiB
Rust
34 lines
1.5 KiB
Rust
//! p9-fb-25 task 3: `kebab init` produces config.toml with a header
|
|
//! comment listing the four supported extensions (md / png / jpg+jpeg
|
|
//! / pdf) so a user editing the config knows what's processable.
|
|
|
|
#[test]
|
|
fn init_workspace_header_lists_supported_extensions() {
|
|
let tmp = tempfile::tempdir().expect("tempdir");
|
|
// SAFETY: Rust 2024 marks set_var as unsafe — wrap in unsafe block.
|
|
// Each test sets process-wide XDG_CONFIG_HOME to point at the
|
|
// tempdir; init_workspace writes config.toml relative to it.
|
|
unsafe {
|
|
std::env::set_var("XDG_CONFIG_HOME", tmp.path());
|
|
// Same dir for data + cache to avoid touching real user paths.
|
|
std::env::set_var("XDG_DATA_HOME", tmp.path().join("data"));
|
|
std::env::set_var("XDG_CACHE_HOME", tmp.path().join("cache"));
|
|
std::env::set_var("XDG_STATE_HOME", tmp.path().join("state"));
|
|
}
|
|
kebab_app::init_workspace(true).expect("init_workspace");
|
|
let cfg_path = kebab_config::Config::xdg_config_path();
|
|
let body = std::fs::read_to_string(&cfg_path)
|
|
.unwrap_or_else(|e| panic!("read config at {}: {e}", cfg_path.display()));
|
|
assert!(
|
|
body.contains("처리 가능한 형식"),
|
|
"header lists supported types section: body=\n{body}"
|
|
);
|
|
assert!(body.contains("Markdown: .md"), "md listed");
|
|
assert!(body.contains(".png .jpg .jpeg"), "image extensions listed");
|
|
assert!(body.contains("PDF: .pdf"), "pdf listed");
|
|
assert!(
|
|
!body.contains("workspace.include"),
|
|
"no leftover include reference"
|
|
);
|
|
}
|