use crate::commands::install::{install_to_with, test_content, test_roster};
#[test]
fn skill_port_batch1_sample_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(&"internal-comms".to_string()),
"internal-comms must be deployed; got {:?}",
result.deployed
);
assert!(
result
.deployed
.contains(&"systematic-debugging".to_string()),
"systematic-debugging must be deployed; got {:?}",
result.deployed
);
assert!(
result
.deployed
.contains(&"systematic-debugging/references/workflow.md".to_string()),
"systematic-debugging's reference files must deploy alongside it; got {:?}",
result.deployed
);
let internal_comms_deployed = paths
.claude_skills_dir()
.join("internal-comms")
.join("SKILL.md");
assert!(
internal_comms_deployed.is_file(),
"expected skill at {}",
internal_comms_deployed.display()
);
assert_eq!(
std::fs::read_to_string(&internal_comms_deployed).unwrap(),
crate::commands::install::test_skill("skills/internal-comms.md"),
);
let debugging_dir = paths.claude_skills_dir().join("systematic-debugging");
assert_eq!(
std::fs::read_to_string(debugging_dir.join("SKILL.md")).unwrap(),
crate::commands::install::test_skill("skills/systematic-debugging.md"),
);
for (file_name, expected) in [
(
"anti-patterns.md",
crate::commands::install::test_skill(
"skills/systematic-debugging/references/anti-patterns.md",
),
),
(
"examples.md",
crate::commands::install::test_skill(
"skills/systematic-debugging/references/examples.md",
),
),
(
"troubleshooting.md",
crate::commands::install::test_skill(
"skills/systematic-debugging/references/troubleshooting.md",
),
),
(
"workflow.md",
crate::commands::install::test_skill(
"skills/systematic-debugging/references/workflow.md",
),
),
] {
let ref_path = debugging_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);
}
}