From d480dd2e39a4a737e91452fa92c0f2b43d6e3e20 Mon Sep 17 00:00:00 2001 From: Isaac Good Date: Sun, 28 Jun 2026 21:05:29 -0700 Subject: [PATCH] [house] Add a Jinja test template This changes the expecations for the output layout. This brings the exercise in line with the problem spec and breaks all existing solutions. --- exercises/practice/house/.meta/example.sh | 4 +- exercises/practice/house/.meta/template.j2 | 22 ++ exercises/practice/house/house.bats | 267 ++++----------------- 3 files changed, 72 insertions(+), 221 deletions(-) create mode 100644 exercises/practice/house/.meta/template.j2 diff --git a/exercises/practice/house/.meta/example.sh b/exercises/practice/house/.meta/example.sh index da233982..2252b3a4 100644 --- a/exercises/practice/house/.meta/example.sh +++ b/exercises/practice/house/.meta/example.sh @@ -33,9 +33,9 @@ main() { verse() { local -i n=$1 - printf "This is the %s\n" "${items[n]}" + printf "This is the %s" "${items[n]}" for ((; n>0; n--)); do - printf "that %s the %s\n" "${that[n]}" "${items[n-1]}" + printf " that %s the %s" "${that[n]}" "${items[n-1]}" done } diff --git a/exercises/practice/house/.meta/template.j2 b/exercises/practice/house/.meta/template.j2 new file mode 100644 index 00000000..67bf7d7a --- /dev/null +++ b/exercises/practice/house/.meta/template.j2 @@ -0,0 +1,22 @@ +{{ header }} +{% for idx, case in cases %} +@test "{{ case["description"] }}" { + {% if idx == 0 %}# {% endif %}[[ $BATS_RUN_SKIPPED == "true" ]] || skip + expected=$(cat <