2022-10-26 23:12:29 +02:00
|
|
|
#!/usr/bin/env bats
|
|
|
|
|
|
|
|
setup() {
|
|
|
|
mkdir -p content/users/test
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "Changing content" {
|
|
|
|
echo "---
|
|
|
|
title: Simple ac_choice edition test
|
|
|
|
---
|
|
|
|
|
|
|
|
hello world
|
|
|
|
" > content/users/test/content_test.md
|
|
|
|
# Necessary for the test setup, but not required in prod
|
|
|
|
echo "new content
|
|
|
|
On multiple lines" > content/users/test/content_test.content
|
|
|
|
|
|
|
|
bin/ac_route.sh "$(pwd)/content/users/test" content_test.content
|
|
|
|
|
|
|
|
[ -e content/users/test/content_test.md ]
|
|
|
|
|
|
|
|
cat content/users/test/content_test.md
|
|
|
|
grep -o "new content" content/users/test/content_test.md
|
|
|
|
grep -o "On multiple lines" content/users/test/content_test.md
|
|
|
|
grep -v "^hello world" content/users/test/content_test.md
|
|
|
|
}
|
|
|
|
|
|
|
|
teardown() {
|
2022-10-26 23:38:40 +02:00
|
|
|
rm -rf content/users/test
|
2022-10-26 23:12:29 +02:00
|
|
|
}
|