#!/bin/sh
#/ Usage: test
#/
#/ Bootstrap and run all tests.
#/

set -e
cd $(dirname "$0")/..

[ "$1" = "--help" -o "$1" = "-h" -o "$1" = "help" ] && {
    grep '^#/' <"$0"| cut -c4-
    exit 0
}

export RAILS_VERSION=5.0.0
script/bootstrap || bundle update
bundle exec rake

export RAILS_VERSION=5.1.4
script/bootstrap || bundle update
bundle exec rake

export RAILS_VERSION=5.2.3
script/bootstrap || bundle update
bundle exec rake

export RAILS_VERSION=6.0.0
script/bootstrap || bundle update
bundle exec rake

export RAILS_VERSION=6.1.0
script/bootstrap || bundle update
bundle exec rake

export RAILS_VERSION=7.0.0
script/bootstrap || bundle update
bundle exec rake

export RAILS_VERSION=7.1.0
script/bootstrap || bundle update
bundle exec rake

export RAILS_VERSION=7.2.0
script/bootstrap || bundle update
bundle exec rake

export RAILS_VERSION=8.0.0
script/bootstrap || bundle update
bundle exec rake
