language: ruby
cache:
  bundler: true
rvm:
  - 2.2.7
  - 2.3.4
  - 2.4.1
gemfile:
  - gemfiles/rails_4.1.gemfile
  - gemfiles/rails_4.2.gemfile
  - gemfiles/rails_5.0.gemfile
  - gemfiles/rails_5.1.gemfile
matrix:
  exclude:
    - rvm: 2.4.1
      gemfile: gemfiles/rails_4.1.gemfile
before_install:
  - gem update bundler
before_script:
  - RAILS_ENV=test bundle exec rake app:db:create app:db:migrate
script:
  - bundle exec rspec
after_script:
  - RAILS_ENV=test bundle exec rake app:db:drop

language: ruby
cache:
  bundler: true
rvm:
  - 2.2.7
  - 2.3.4
  - 2.4.1
gemfile:
  - gemfiles/rails_4.1.gemfile
  - gemfiles/rails_4.2.gemfile
  - gemfiles/rails_5.0.gemfile
  - gemfiles/rails_5.1.gemfile
matrix:
  exclude:
    - rvm: 2.4.1
      gemfile: gemfiles/rails_4.1.gemfile
before_install:
  - gem update bundler
before_script:
  - cp spec/dummy/config/database.yml.ci spec/dummy/config/database.yml
  - RAILS_ENV=test bundle exec rake app:db:create app:db:migrate
script:
  - bundle exec rspec
after_script:
  - RAILS_ENV=test bundle exec rake app:db:drop

Add database.yml back to CI build
Add database.yml back to CI build
