Skip to content

Commit 8b885e0

Browse files
committed
Fix test suite and test against multiple ruby/rails versions
1 parent 975793f commit 8b885e0

File tree

3 files changed

+31
-6
lines changed

3 files changed

+31
-6
lines changed

.travis.yml

+16-5
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,33 @@ env:
66
global:
77
- CC_TEST_REPORTER_ID=98c9b3070ea9ac0e8f7afb6570f181506c3a06372b1db5c7deb8e46089fdf132
88
- 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)
9+
matrix:
10+
- RAILS_VERSION=5.0.0
11+
- RAILS_VERSION=5.1.0
12+
- RAILS_VERSION=5.2.0
13+
- RAILS_VERSION=master
914
rvm:
10-
- 2.2.2
11-
- 2.3.3
15+
- 2.2.10
16+
- 2.3.7
17+
- 2.4.4
18+
- 2.5.1
1219
- ruby-head
1320
matrix:
1421
allow_failures:
1522
- rvm: ruby-head
23+
- env: RAILS_VERSION=master
24+
exclude:
25+
- rvm: 2.3.7
26+
env: RAILS_VERSION=master
1627
before_script:
1728
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
1829
- chmod +x ./cc-test-reporter
1930
- ./cc-test-reporter before-build
2031
after_script:
21-
# Preferably you will run test-reporter on branch update events. But
22-
# if you setup travis to build PR updates only, you don't need to run
32+
# Preferably you will run test-reporter on branch update events. But
33+
# if you setup travis to build PR updates only, you don't need to run
2334
# the line below
2435
- if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT; fi
25-
# In the case where travis is setup to build PR updates only,
36+
# In the case where travis is setup to build PR updates only,
2637
# uncomment the line below
2738
# - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT

Gemfile

+12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
11
source 'https://rubygems.org'
22

3+
rails_version = ENV['RAILS_VERSION'] || "default"
4+
rails = case rails_version
5+
when 'master'
6+
{ github: 'rails/rails' }
7+
when 'default'
8+
'>= 5.0'
9+
else
10+
"~> #{ENV['RAILS_VERSION']}"
11+
end
12+
13+
gem 'rails', rails
14+
315
gemspec

spec/dummy/config/initializers/new_framework_defaults.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
Rails.application.config.active_record.belongs_to_required_by_default = true
1919

2020
# Do not halt callback chains when a callback returns false. Previous versions had true.
21-
ActiveSupport.halt_callback_chains_on_return_false = false
21+
if Rails.version.to_f < 5.2
22+
ActiveSupport.halt_callback_chains_on_return_false = false
23+
end
2224

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

0 commit comments

Comments
 (0)