#!/usr/bin/env bash

set -x

if [[ ${TRAVIS_RUBY_VERSION} == "2.1" ]]; then
  # ruby 2.1
  export NO_COVERAGE="true" # No coverage for rails 4, because controller specs are disabled
  bundle exec rake rails4:test --trace
else
  # ruby >= 2.2
  bundle exec rake --trace
  bundle exec codeclimate-test-reporter
fi

#!/usr/bin/env bash

set -x

if [[ ${TRAVIS_RUBY_VERSION} == "2.1" ]]; then
  # ruby 2.1
  export NO_COVERAGE="true" # No coverage for rails 4, because controller specs are disabled
  bundle exec rake rails4:test --trace
else
  # ruby >= 2.2
  bundle exec rake --trace
  test_exit_code=$?
  bundle exec codeclimate-test-reporter
  exit $test_exit_code
fi

Fix CI script false positive return code
Fix CI script false positive return code

For Ruby >= 2.2 travis.sh returned 0 even when the rspec test suite
has failed. This commit passes the return value from the test suite
as the CI script return value.
