#!/usr/bin/env bash # Use this script to safely run the test suite. # This must be preferred over `rails test`. stripe_public_key=$(RAILS_ENV='test' bin/rails runner "puts ENV['STRIPE_PUBLISHABLE_KEY']") stripe_secret_key=$(RAILS_ENV='test' bin/rails runner "puts ENV['STRIPE_API_KEY']") if [[ -z "$stripe_public_key" ]]; then read -rp "STRIPE_PUBLISHABLE_KEY is not set. Please input the public key now. > " stripe_public_key " stripe_secret_key