#!/bin/bash

set -e

bundle install
bundle exec rubocop .
bundle exec rspec spec

if [[ "$SUITE_NAME" == "bundler1" ]]; then
  cd helpers/v1 \
    && BUNDLER_VERSION=1 bundle install \
    && BUNDLER_VERSION=1 bundle exec rspec spec\
    && cd -
fi

if [[ "$SUITE_NAME" == "bundler2" ]]; then
  cd helpers/v2 \
    && BUNDLER_VERSION=2 bundle install \
    && BUNDLER_VERSION=2 bundle exec rspec spec \
    && cd -
fi
