Skip to content

Commit

Permalink
Reflect bats changes (exercism/bash#541) (exercism#27)
Browse files Browse the repository at this point in the history
* Reflect bats changes (exercism/bash#541)

* style
  • Loading branch information
braoult authored and glennj committed Sep 23, 2021
1 parent 0a6c1a5 commit bd3467a
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion bin/run.sh
Expand Up @@ -68,14 +68,17 @@ run_tests() {
# Run tests and pipe output to results.out file.

local slug="$1"
local test_file=${slug//-/_}_test.sh
local solution_dir="$2"
local output_file="$3"

echo "Running tests."

cd "$solution_dir"

local test_file="${slug//-/_}.bats"
# test scripts may be (old) xxxx_test.sh
[[ -f "$test_file" ]] || test_file="${slug//-/_}_test.sh"

sed -i 's/load bats-extra.bash/load bats-extra/' "$test_file" || true

echo "Test output:"
Expand Down
2 changes: 1 addition & 1 deletion tests/data/middle_fails/expected_results.json
@@ -1 +1 @@
{ "version": 2, "status": "fail", "tests": [{ "name": "say one", "status": "pass" },{ "name": "say two", "status": "fail", "message": "(in test file middle_fails_test.sh, line 12)\n `[ \"$output\" == \"two\" ]' failed\n"},{ "name": "say three", "status": "pass" }]}
{ "version": 2, "status": "fail", "tests": [{ "name": "say one", "status": "pass" },{ "name": "say two", "status": "fail", "message": "(in test file middle_fails.bats, line 12)\n `[ \"$output\" == \"two\" ]' failed\n"},{ "name": "say three", "status": "pass" }]}
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/data/missing_script/expected_results.json
@@ -1 +1 @@
{ "version": 2, "status": "fail", "tests": [{ "name": "say hello", "status": "fail", "message": "(in test file missing_script_test.sh, line 5)\n `[ \"$status\" -eq 0 ]' failed with status 127\n"}]}
{ "version": 2, "status": "fail", "tests": [{ "name": "say hello", "status": "fail", "message": "(in test file missing_script.bats, line 5)\n `[ \"$status\" -eq 0 ]' failed with status 127\n"}]}
File renamed without changes.
File renamed without changes.

0 comments on commit bd3467a

Please sign in to comment.