Files
aperonight/test.sh
2025-08-28 13:43:05 +02:00

19 lines
533 B
Bash

#!/usr/bin/env bash
# Check if a directory/file argument is provided
if [ -n "$1" ]; then
# Get the test directory/file from the first argument
TEST_PATH="$1"
# Check if the provided argument is a directory or file
if [ -d "$TEST_PATH" ] || [ -f "$TEST_PATH" ]; then
# Run Rails tests in the specified directory/file
bundle exec rails test "$TEST_PATH"
else
echo "Error: $TEST_PATH is not a valid directory or file"
exit 1
fi
else
# Run Rails tests in the current directory
bundle exec rails test
fi