use crate::commands::install::{install_to_with, test_content, test_roster};
#[test]
fn documentation_style_lands_in_deployed_dot_claude_skills() {
let dir = tempfile::tempdir().unwrap();
let paths = trusty_mpm::core::paths::FrameworkPaths::under(dir.path());
install_to_with(&paths, false, &test_roster(), &test_content()).unwrap();
let result = trusty_mpm::core::skill_tiers::deploy_all_skill_tiers(
&paths.skill_source_dir(),
&paths.user_skill_source_dir(),
&paths.claude_skills_dir(),
|_| true,
)
.unwrap()
.stats;
assert!(
result.deployed.contains(&"documentation-style".to_string()),
"documentation-style must be deployed; got {:?}",
result.deployed
);
assert!(
result
.deployed
.contains(&"documentation-style/references/method-function.md".to_string()),
"documentation-style's reference files must deploy alongside it; got {:?}",
result.deployed
);
let skill_dir = paths.claude_skills_dir().join("documentation-style");
assert_eq!(
std::fs::read_to_string(skill_dir.join("SKILL.md")).unwrap(),
crate::commands::install::test_skill("skills/documentation-style.md"),
);
for (file_name, expected) in [
(
"spec.md",
crate::commands::install::test_skill("skills/documentation-style/references/spec.md"),
),
(
"readme.md",
crate::commands::install::test_skill("skills/documentation-style/references/readme.md"),
),
(
"file-level.md",
crate::commands::install::test_skill(
"skills/documentation-style/references/file-level.md",
),
),
(
"class.md",
crate::commands::install::test_skill("skills/documentation-style/references/class.md"),
),
(
"method-function.md",
crate::commands::install::test_skill(
"skills/documentation-style/references/method-function.md",
),
),
(
"block-inline.md",
crate::commands::install::test_skill(
"skills/documentation-style/references/block-inline.md",
),
),
] {
let ref_path = skill_dir.join("references").join(file_name);
assert!(
ref_path.is_file(),
"expected reference file at {}",
ref_path.display()
);
assert_eq!(std::fs::read_to_string(&ref_path).unwrap(), expected);
}
}