#!/bin/sh

set -e

# Install required gems, including Appraisal, which helps us test against
# multiple Rails versions
gem install bundler --conservative
bundle check || bundle install

if [ -z "$CI" ]; then
  bundle exec appraisal install
fi

# Set up database for the application that Clearance tests against
RAILS_ENV=test bundle exec rake dummy:db:drop
RAILS_ENV=test bundle exec rake dummy:db:setup
