Skip to content

Commit 770a6b9

Browse files
committed
try 2
Signed-off-by: Exadra37 <[email protected]>
1 parent 9ef1518 commit 770a6b9

File tree

1 file changed

+35
-5
lines changed

1 file changed

+35
-5
lines changed

test/ai-intent-driven-development.sh.bats

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ setup() {
88
BATS_TMPDIR="$(mktemp -d -t bats-test-XXXXXX)"
99

1010
# Define the path for our isolated project clone.
11-
PROJECT_COPY_TEST_DIR="${BATS_TMPDIR}/ai-intent-driven-development-copy-test"
11+
PROJECT_COPY_TEST_DIR="${BATS_TMPDIR}/ai-intent-driven-development-copy-for-test"
1212

1313
# Copy the current state of the repository to the clone directory.
1414
cp -r "$PWD/" "$PROJECT_COPY_TEST_DIR"
@@ -20,9 +20,8 @@ setup() {
2020
SCRIPT_PATH="${PROJECT_COPY_TEST_DIR}/bin/ai-intent-driven-development.sh"
2121

2222
# `cd` into a separate "working" directory for the test to run commands in.
23-
mkdir "${BATS_TMPDIR}/work"
24-
cd "${BATS_TMPDIR}/work"
25-
pwd
23+
mkdir "${BATS_TMPDIR}/workspace"
24+
cd "${BATS_TMPDIR}/workspace"
2625

2726
# Initialize this working directory as a git repo so the script's checks pass.
2827
git init &> /dev/null
@@ -32,7 +31,6 @@ setup() {
3231
}
3332

3433
teardown() {
35-
pwd
3634
rm -rf "${BATS_TMPDIR}"
3735
}
3836

@@ -73,6 +71,38 @@ teardown() {
7371

7472
# --- Test 'from-scratch' Command Permutations ---
7573

74+
@test "from-scratch (elixir and phoenix with framework AGENTS.md)" {
75+
cd "$PROJECT_COPY_TEST_DIR"
76+
mkdir -p "elixir/phoenix"
77+
echo "# FRAMEWORK AGENTS" > "elixir/phoenix/AGENTS.md"
78+
git add "elixir/phoenix/AGENTS.md"
79+
git commit -m 'agents file' &> /dev/null
80+
cd -
81+
82+
run "$SCRIPT_PATH" from-scratch elixir phoenix
83+
assert_success
84+
assert [ -f "AGENTS.md" ]
85+
86+
run cat AGENTS.md
87+
assert_output --partial "# FRAMEWORK AGENTS"
88+
}
89+
90+
@test "from-scratch (elixir with language AGENTS.md)" {
91+
cd "$PROJECT_COPY_TEST_DIR"
92+
mkdir -p "elixir"
93+
echo "# LANGUAGE AGENTS" > "elixir/AGENTS.md"
94+
git add "elixir/AGENTS.md"
95+
git commit -m 'agents file' &> /dev/null
96+
cd -
97+
98+
run "$SCRIPT_PATH" from-scratch elixir
99+
assert_success
100+
assert [ -f "AGENTS.md" ]
101+
102+
run cat AGENTS.md
103+
assert_output --partial "# LANGUAGE AGENTS"
104+
}
105+
76106
@test "from-scratch (agnostic)" {
77107
run "$SCRIPT_PATH" from-scratch
78108
assert_success

0 commit comments

Comments
 (0)