mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-24 18:00:58 +01:00
tests/claude-code: add path tests for agents/commands
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
parent
846f27fba8
commit
fb928abb67
6 changed files with 86 additions and 0 deletions
14
tests/modules/programs/claude-code/agents-path.nix
Normal file
14
tests/modules/programs/claude-code/agents-path.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
programs.claude-code = {
|
||||
enable = true;
|
||||
agents = {
|
||||
test-agent = ./test-agent.md;
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.claude/agents/test-agent.md
|
||||
assertFileContent home-files/.claude/agents/test-agent.md \
|
||||
${./test-agent.md}
|
||||
'';
|
||||
}
|
||||
14
tests/modules/programs/claude-code/commands-path.nix
Normal file
14
tests/modules/programs/claude-code/commands-path.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
programs.claude-code = {
|
||||
enable = true;
|
||||
commands = {
|
||||
test-command = ./test-command.md;
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.claude/commands/test-command.md
|
||||
assertFileContent home-files/.claude/commands/test-command.md \
|
||||
${./test-command.md}
|
||||
'';
|
||||
}
|
||||
|
|
@ -8,4 +8,7 @@
|
|||
claude-code-agents-dir = ./agents-dir.nix;
|
||||
claude-code-commands-dir = ./commands-dir.nix;
|
||||
claude-code-hooks-dir = ./hooks-dir.nix;
|
||||
claude-code-agents-path = ./agents-path.nix;
|
||||
claude-code-commands-path = ./commands-path.nix;
|
||||
claude-code-mixed-content = ./mixed-content.nix;
|
||||
}
|
||||
|
|
|
|||
38
tests/modules/programs/claude-code/mixed-content.nix
Normal file
38
tests/modules/programs/claude-code/mixed-content.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
programs.claude-code = {
|
||||
enable = true;
|
||||
commands = {
|
||||
inline-command = ''
|
||||
---
|
||||
allowed-tools: Read
|
||||
description: Inline command
|
||||
---
|
||||
This command is defined inline.
|
||||
'';
|
||||
path-command = ./test-command.md;
|
||||
};
|
||||
agents = {
|
||||
inline-agent = ''
|
||||
---
|
||||
name: inline-agent
|
||||
description: Inline agent
|
||||
tools: Read
|
||||
---
|
||||
This agent is defined inline.
|
||||
'';
|
||||
path-agent = ./test-agent.md;
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.claude/commands/inline-command.md
|
||||
assertFileExists home-files/.claude/commands/path-command.md
|
||||
assertFileExists home-files/.claude/agents/inline-agent.md
|
||||
assertFileExists home-files/.claude/agents/path-agent.md
|
||||
|
||||
assertFileContent home-files/.claude/commands/path-command.md \
|
||||
${./test-command.md}
|
||||
assertFileContent home-files/.claude/agents/path-agent.md \
|
||||
${./test-agent.md}
|
||||
'';
|
||||
}
|
||||
8
tests/modules/programs/claude-code/test-agent.md
Normal file
8
tests/modules/programs/claude-code/test-agent.md
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
name: test-agent
|
||||
description: Test agent loaded from file path
|
||||
tools: Read, Write
|
||||
---
|
||||
|
||||
This is a test agent loaded from a file path.
|
||||
Used to verify path support functionality.
|
||||
9
tests/modules/programs/claude-code/test-command.md
Normal file
9
tests/modules/programs/claude-code/test-command.md
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
allowed-tools: Bash, Read
|
||||
argument-hint: [test-arg]
|
||||
description: Test command loaded from file path
|
||||
---
|
||||
|
||||
This is a test command loaded from a file path.
|
||||
Used to verify path support functionality.
|
||||
Usage: /test-command [test-arg]
|
||||
Loading…
Add table
Add a link
Reference in a new issue