Skip to content

Commit

Permalink
Fix test suite and test against multiple ruby/rails versions
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeWoodward committed Sep 2, 2018
1 parent 975793f commit a01e8f0
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
17 changes: 12 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,29 @@ env:
global:
- CC_TEST_REPORTER_ID=98c9b3070ea9ac0e8f7afb6570f181506c3a06372b1db5c7deb8e46089fdf132
- GIT_COMMITTED_AT=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then git log -1 --pretty=format:%ct; else git log -1 --skip 1 --pretty=format:%ct; fi)
matrix:
- RAILS_VERSION=5.0.0
- RAILS_VERSION=5.1.0
- RAILS_VERSION=master
rvm:
- 2.2.2
- 2.3.3
- 2.2.10
- 2.3.7
- 2.4.4
- 2.5.1
- ruby-head
matrix:
allow_failures:
- rvm: ruby-head
- env: RAILS_VERSION=master
before_script:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
after_script:
# Preferably you will run test-reporter on branch update events. But
# if you setup travis to build PR updates only, you don't need to run
# Preferably you will run test-reporter on branch update events. But
# if you setup travis to build PR updates only, you don't need to run
# the line below
- if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT; fi
# In the case where travis is setup to build PR updates only,
# In the case where travis is setup to build PR updates only,
# uncomment the line below
# - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
12 changes: 12 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
source 'https://rubygems.org'

rails_version = ENV['RAILS_VERSION'] || "default"
rails = case rails_version
when 'master'
{ github: 'rails/rails' }
when 'default'
'>= 5.0'
else
"~> #{ENV['RAILS_VERSION']}"
end

gem 'rails', rails

gemspec
4 changes: 3 additions & 1 deletion spec/dummy/config/initializers/new_framework_defaults.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
Rails.application.config.active_record.belongs_to_required_by_default = true

# Do not halt callback chains when a callback returns false. Previous versions had true.
ActiveSupport.halt_callback_chains_on_return_false = false
if Rails.version.to_f < 5.2
ActiveSupport.halt_callback_chains_on_return_false = false
end

# Configure SSL options to enable HSTS with subdomains. Previous versions had false.
Rails.application.config.ssl_options = { hsts: { subdomains: true } }

0 comments on commit a01e8f0

Please sign in to comment.