fix(kyberforge): fix bats SCRIPT path and clarify test helper install location
Both validate.bats and new-skill.bats constructed SCRIPT using $(dirname "$BATS_TEST_FILENAME"), which resolves to tests/ — causing every test to fail with file-not-found. Fixed to use $BATS_TEST_DIRNAME/../scripts/ to reach the actual scripts/ directory. Also clarifies that bats-support/bats-assert must be installed from the repo root (not the skill root) to match where the tests load them from, and adds text language tags to three output-template code blocks in skill-audit's SKILL.md. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -97,7 +97,7 @@ Check each pattern is appropriate and correctly formed:
|
|||||||
|
|
||||||
Open with a coverage line listing every dimension checked:
|
Open with a coverage line listing every dimension checked:
|
||||||
|
|
||||||
```
|
```text
|
||||||
Checked: structure · description · body-discipline · patterns · file-structure · formatting · scripts · internal-consistency
|
Checked: structure · description · body-discipline · patterns · file-structure · formatting · scripts · internal-consistency
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -105,7 +105,7 @@ Then output only dimensions that have findings, grouped under H3 headings, FAILs
|
|||||||
|
|
||||||
For each finding:
|
For each finding:
|
||||||
|
|
||||||
```
|
```text
|
||||||
FAIL/SUGGESTION <finding> — file:line
|
FAIL/SUGGESTION <finding> — file:line
|
||||||
Why: <why this is a problem>
|
Why: <why this is a problem>
|
||||||
Fix: <exact change — quote before/after where applicable>
|
Fix: <exact change — quote before/after where applicable>
|
||||||
@@ -113,7 +113,7 @@ FAIL/SUGGESTION <finding> — file:line
|
|||||||
|
|
||||||
Close with a result block:
|
Close with a result block:
|
||||||
|
|
||||||
```
|
```text
|
||||||
## Result
|
## Result
|
||||||
|
|
||||||
PASS / PASS (N suggestions) / FAIL (N fails · M suggestions)
|
PASS / PASS (N suggestions) / FAIL (N fails · M suggestions)
|
||||||
|
|||||||
@@ -5,18 +5,20 @@ Test files for scripts bundled with this skill.
|
|||||||
## Dependencies
|
## Dependencies
|
||||||
|
|
||||||
Tests require [bats-support](https://github.com/bats-core/bats-support) and
|
Tests require [bats-support](https://github.com/bats-core/bats-support) and
|
||||||
[bats-assert](https://github.com/bats-core/bats-assert) installed under
|
[bats-assert](https://github.com/bats-core/bats-assert). The test files load
|
||||||
`tests/test_helper/`:
|
helpers from the repo root's `tests/test_helper/`.
|
||||||
|
|
||||||
|
From the repo root:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/bats-core/bats-support tests/test_helper/bats-support
|
git clone https://github.com/bats-core/bats-support tests/test_helper/bats-support
|
||||||
git clone https://github.com/bats-core/bats-assert tests/test_helper/bats-assert
|
git clone https://github.com/bats-core/bats-assert tests/test_helper/bats-assert
|
||||||
```
|
```
|
||||||
|
|
||||||
Run all tests:
|
Run all tests for this skill (from the repo root):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
bats tests/
|
bats plugins/kyberforge/skills/skill-audit/tests/
|
||||||
```
|
```
|
||||||
|
|
||||||
## Files
|
## Files
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ setup() {
|
|||||||
load "$REPO_ROOT/tests/test_helper/bats-support/load"
|
load "$REPO_ROOT/tests/test_helper/bats-support/load"
|
||||||
load "$REPO_ROOT/tests/test_helper/bats-assert/load"
|
load "$REPO_ROOT/tests/test_helper/bats-assert/load"
|
||||||
|
|
||||||
SCRIPT="$(cd "$(dirname "$BATS_TEST_FILENAME")" && pwd)/validate.sh"
|
SCRIPT="$(cd "$BATS_TEST_DIRNAME/../scripts" && pwd)/validate.sh"
|
||||||
TMPDIR="$(mktemp -d)"
|
TMPDIR="$(mktemp -d)"
|
||||||
|
|
||||||
# Helper: create a minimal valid skill directory
|
# Helper: create a minimal valid skill directory
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ This skill produces its best output when you arrive with rich context:
|
|||||||
| `assets/templates/references/README.md` | Placeholder for reference docs |
|
| `assets/templates/references/README.md` | Placeholder for reference docs |
|
||||||
| `assets/templates/assets/README.md` | Placeholder for static assets |
|
| `assets/templates/assets/README.md` | Placeholder for static assets |
|
||||||
| `assets/templates/tests/README.md` | Placeholder for test files |
|
| `assets/templates/tests/README.md` | Placeholder for test files |
|
||||||
| `tests/new-skill.bats` | Bats test suite for new-skill.sh — requires bats-support and bats-assert under `tests/test_helper/` |
|
| `tests/new-skill.bats` | Bats test suite for new-skill.sh — requires bats-support and bats-assert in the repo root's `tests/test_helper/` (see skill-audit's `tests/README.md` for setup) |
|
||||||
|
|
||||||
## Placement
|
## Placement
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ setup() {
|
|||||||
load "$REPO_ROOT/tests/test_helper/bats-support/load"
|
load "$REPO_ROOT/tests/test_helper/bats-support/load"
|
||||||
load "$REPO_ROOT/tests/test_helper/bats-assert/load"
|
load "$REPO_ROOT/tests/test_helper/bats-assert/load"
|
||||||
|
|
||||||
SCRIPT="$(cd "$(dirname "$BATS_TEST_FILENAME")" && pwd)/new-skill.sh"
|
SCRIPT="$(cd "$BATS_TEST_DIRNAME/../scripts" && pwd)/new-skill.sh"
|
||||||
DEST="$(mktemp -d)"
|
DEST="$(mktemp -d)"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user