From 3f0d2a807942de797643414dfaffd39fe1352d0e Mon Sep 17 00:00:00 2001 From: Mike Bland Date: Fri, 17 Feb 2017 11:07:40 -0500 Subject: [PATCH] ass-test-help: Fix tests failing under MSYS2 The `#! /usr/bin/env bash` was missing from `create_failing_test_stub`, causing the two tests using it to fail under MSYS2, which uses the shebang to determine whether or not a script is executable in lieu of using `chmod` to set file permissions. --- tests/assertion-test-helpers.bats | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/assertion-test-helpers.bats b/tests/assertion-test-helpers.bats index 660db2a..9c5ed10 100644 --- a/tests/assertion-test-helpers.bats +++ b/tests/assertion-test-helpers.bats @@ -31,7 +31,8 @@ create_failing_test_stub() { if [[ ! -d "$BATS_TMPDIR/bin" ]]; then mkdir -p "$BATS_TMPDIR/bin" fi - printf '%s\n' 'printf "ARG: \"%s\"\n" "$@"' 'exit 1' >"$cmd_path" + printf '%s\n' '#! /usr/bin/env bash' \ + 'printf "ARG: \"%s\"\n" "$@"' 'exit 1' >"$cmd_path" chmod 755 "$cmd_path" PATH="$BATS_TMPDIR/bin:$PATH" hash "$cmd_name"