@@ -23,6 +23,12 @@ echo "=== test-gh-availability-check.sh ==="
2323_TMP=$( mktemp -d)
2424trap ' rm -rf "$_TMP"' EXIT
2525
26+ # Create a PATH directory containing bash but NOT gh, for not-installed tests.
27+ # Using /usr/bin:/bin doesn't work in CI where gh is at /usr/bin/gh.
28+ _NO_GH_PATH=" $_TMP /no-gh-path"
29+ mkdir -p " $_NO_GH_PATH "
30+ ln -s " $( command -v bash) " " $_NO_GH_PATH /bash"
31+
2632# =============================================================================
2733# test_gh_authenticated: Mock gh in PATH, mock gh auth status exit 0
2834# assert output GH_STATUS=authenticated
@@ -82,7 +88,7 @@ echo ""
8288echo " --- test_gh_not_installed ---"
8389_snapshot_fail
8490
85- not_installed_output=$( PATH=" /usr/bin:/bin " bash " $GH_AVAIL " 2>&1 )
91+ not_installed_output=$( PATH=" $_NO_GH_PATH " bash " $GH_AVAIL " 2>&1 )
8692assert_contains " test_gh_not_installed: GH_STATUS=not_installed in output" " GH_STATUS=not_installed" " $not_installed_output "
8793assert_contains " test_gh_not_installed: FALLBACK=ui_steps in output" " FALLBACK=ui_steps" " $not_installed_output "
8894
@@ -110,7 +116,7 @@ echo ""
110116echo " --- test_fallback_ui_steps_format ---"
111117_snapshot_fail
112118
113- ui_steps_output=$( PATH=" /usr/bin:/bin " bash " $GH_AVAIL " 2>&1 )
119+ ui_steps_output=$( PATH=" $_NO_GH_PATH " bash " $GH_AVAIL " 2>&1 )
114120assert_contains " test_fallback_ui_steps_format: github.com reference in output" " github.com" " $ui_steps_output "
115121
116122assert_pass_if_clean " test_fallback_ui_steps_format"
0 commit comments