Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reflect bats changes (https://github.com/exercism/bash/pull/541) #27

Merged
merged 2 commits into from Sep 17, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion bin/run.sh
Expand Up @@ -66,14 +66,17 @@ run_tests() {
# Run tests and pipe output to results.out file.

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

echo "Running tests."

cd "$solution_dir"

# test scripts may be (old) xxxx_test.sh
[[ -f "$test_file" ]] || test_file=${slug//-/_}_test.sh
braoult marked this conversation as resolved.
Show resolved Hide resolved

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" }]}
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"}]}