mirror of
https://github.com/thoughtbot/factory_bot_rails.git
synced 2022-11-09 11:49:18 -05:00
Test against Rails 5.1 and 5.2 (#278)
- Add Rails 5.1 and 5.2 to Appraisal - Avoid running combinations we know are going to fail by moving to "exclude" instead of "allow_failures" - Use updated migration class for Rails 5.1+
This commit is contained in:
parent
15079c2a22
commit
c9fc696325
6 changed files with 75 additions and 8 deletions
11
.travis.yml
11
.travis.yml
|
@ -23,12 +23,17 @@ gemfile:
|
|||
- gemfiles/rails4.1.gemfile
|
||||
- gemfiles/rails4.2.gemfile
|
||||
- gemfiles/rails5.0.gemfile
|
||||
- gemfiles/rails5.1.gemfile
|
||||
- gemfiles/rails5.2.gemfile
|
||||
matrix:
|
||||
fast_finish: true
|
||||
allow_failures:
|
||||
- rvm: ruby-head
|
||||
exclude:
|
||||
- rvm: 2.1
|
||||
gemfile: gemfiles/rails5.0.gemfile
|
||||
- rvm: 2.1
|
||||
gemfile: gemfiles/rails5.1.gemfile
|
||||
- rvm: 2.1
|
||||
gemfile: gemfiles/rails5.2.gemfile
|
||||
# Ruby 2.4+ doesn't work with ActiveSupport 4.1
|
||||
# https://github.com/rails/rails/pull/25161
|
||||
# https://github.com/rails/rails/pull/25737
|
||||
|
@ -36,3 +41,5 @@ matrix:
|
|||
gemfile: gemfiles/rails4.1.gemfile
|
||||
- rvm: 2.5
|
||||
gemfile: gemfiles/rails4.1.gemfile
|
||||
allow_failures:
|
||||
- rvm: ruby-head
|
||||
|
|
17
Appraisals
17
Appraisals
|
@ -14,8 +14,17 @@ appraise 'rails4.2' do
|
|||
gem 'rails', '~> 4.2.0'
|
||||
end
|
||||
|
||||
appraise "rails5.0" do
|
||||
gem "activerecord", "~> 5.0.0"
|
||||
gem "railties", "~> 5.0.0"
|
||||
gem "rspec-rails", "~> 3.5.0.beta4"
|
||||
appraise 'rails5.0' do
|
||||
gem 'activerecord', '~> 5.0.0'
|
||||
gem 'railties', '~> 5.0.0'
|
||||
end
|
||||
|
||||
appraise 'rails5.1' do
|
||||
gem 'activerecord', '~> 5.1.0'
|
||||
gem 'railties', '~> 5.1.0'
|
||||
end
|
||||
|
||||
appraise 'rails5.2' do
|
||||
gem 'activerecord', '~> 5.2.0'
|
||||
gem 'railties', '~> 5.2.0'
|
||||
end
|
||||
|
|
|
@ -8,7 +8,14 @@ Feature: automatically load step definitions
|
|||
And I run `bundle install` with a clean environment
|
||||
And I write to "db/migrate/1_create_users.rb" with:
|
||||
"""
|
||||
class CreateUsers < ActiveRecord::Migration
|
||||
migration_class =
|
||||
if ActiveRecord::Migration.respond_to?(:[])
|
||||
ActiveRecord::Migration[4.2]
|
||||
else
|
||||
ActiveRecord::Migration
|
||||
end
|
||||
|
||||
class CreateUsers < migration_class
|
||||
def self.up
|
||||
create_table :users do |t|
|
||||
t.string :name
|
||||
|
|
|
@ -8,7 +8,7 @@ gem "coffee-rails"
|
|||
gem "cucumber", "1.3.19"
|
||||
gem "jquery-rails"
|
||||
gem "rake"
|
||||
gem "rspec-rails", "~> 3.5.0.beta4"
|
||||
gem "rspec-rails"
|
||||
gem "uglifier"
|
||||
gem "test-unit"
|
||||
gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby
|
||||
|
|
22
gemfiles/rails5.1.gemfile
Normal file
22
gemfiles/rails5.1.gemfile
Normal file
|
@ -0,0 +1,22 @@
|
|||
# This file was generated by Appraisal
|
||||
|
||||
source "https://rubygems.org"
|
||||
|
||||
gem "appraisal"
|
||||
gem "aruba"
|
||||
gem "coffee-rails"
|
||||
gem "cucumber", "1.3.19"
|
||||
gem "jquery-rails"
|
||||
gem "rake"
|
||||
gem "rspec-rails"
|
||||
gem "uglifier"
|
||||
gem "test-unit"
|
||||
gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby
|
||||
gem "jdbc-sqlite3", :platforms => :jruby
|
||||
gem "therubyrhino", :platforms => :jruby
|
||||
gem "jruby-openssl", :platforms => :jruby
|
||||
gem "sqlite3", :platforms => :ruby
|
||||
gem "activerecord", "~> 5.1.0"
|
||||
gem "railties", "~> 5.1.0"
|
||||
|
||||
gemspec :name => "factory_bot_rails", :path => "../"
|
22
gemfiles/rails5.2.gemfile
Normal file
22
gemfiles/rails5.2.gemfile
Normal file
|
@ -0,0 +1,22 @@
|
|||
# This file was generated by Appraisal
|
||||
|
||||
source "https://rubygems.org"
|
||||
|
||||
gem "appraisal"
|
||||
gem "aruba"
|
||||
gem "coffee-rails"
|
||||
gem "cucumber", "1.3.19"
|
||||
gem "jquery-rails"
|
||||
gem "rake"
|
||||
gem "rspec-rails"
|
||||
gem "uglifier"
|
||||
gem "test-unit"
|
||||
gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby
|
||||
gem "jdbc-sqlite3", :platforms => :jruby
|
||||
gem "therubyrhino", :platforms => :jruby
|
||||
gem "jruby-openssl", :platforms => :jruby
|
||||
gem "sqlite3", :platforms => :ruby
|
||||
gem "activerecord", "~> 5.2.0"
|
||||
gem "railties", "~> 5.2.0"
|
||||
|
||||
gemspec :name => "factory_bot_rails", :path => "../"
|
Loading…
Reference in a new issue