mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-11 21:26:44 +00:00
test-unit-php and test-unit-ruby exited 0 whenever the interpreter or the vendor tree was missing, so both suites were silently absent from every gate. They now provision their toolchain through install-php/install-ruby and fail loudly when that is impossible. The three ensure_*_present helpers collapse into ensure_command_present in system_pkg, and the ruby runner rejects an empty suite because minitest reports success when nothing was required.
23 lines
573 B
Bash
Executable File
23 lines
573 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# shellcheck shell=bash
|
|
#
|
|
# Runs the Ruby unit suite through minitest, which ships with Ruby itself.
|
|
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
|
|
REPO_ROOT="$(cd -- "${SCRIPT_DIR}/../../.." && pwd)"
|
|
|
|
cd "${REPO_ROOT}"
|
|
|
|
suite="tests/unit/ruby"
|
|
|
|
mapfile -t tests < <(find "${suite}" -name '*_test.rb' | sort)
|
|
|
|
if ((${#tests[@]} == 0)); then
|
|
printf 'ERROR test-unit-ruby: no Ruby unit tests in %s\n' "${suite}" >&2
|
|
exit 1
|
|
fi
|
|
|
|
exec ruby -I"${suite}" -e 'ARGV.each { |f| require File.expand_path(f) }' "${tests[@]}"
|