mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-22 22:06:50 +00:00
Run CI against Rails >= 4.0, Ruby >= 1.9.3
This commit is contained in:
parent
d03b8179f5
commit
75252a2ef9
48
.travis.yml
48
.travis.yml
@ -1,12 +1,46 @@
|
||||
language: ruby
|
||||
sudo: false
|
||||
rvm:
|
||||
- 1.9.3
|
||||
- 2.0.0
|
||||
# - 1.8.7
|
||||
# - ree
|
||||
# - jruby-18mode
|
||||
# - 1.9.2
|
||||
# - 1.9.3
|
||||
- jruby-19mode
|
||||
- 2.0.0
|
||||
- 2.1
|
||||
- 2.2
|
||||
- rbx-2
|
||||
gemfile:
|
||||
- Gemfile
|
||||
- Gemfile.edge
|
||||
install: bundle install --path=vendor/bundle --retry=3 --jobs=3
|
||||
cache:
|
||||
directories:
|
||||
- vendor/bundle
|
||||
script:
|
||||
- bundle exec rake ci
|
||||
env:
|
||||
# - "RAILS_VERSION=3.0"
|
||||
# - "RAILS_VERSION=3.1"
|
||||
# - "RAILS_VERSION=3.2"
|
||||
- "RAILS_VERSION=4.0"
|
||||
- "RAILS_VERSION=4.1"
|
||||
- "RAILS_VERSION=4.2"
|
||||
- "RAILS_VERSION=master"
|
||||
matrix:
|
||||
allow_failures:
|
||||
- gemfile: Gemfile.edge
|
||||
exclude:
|
||||
# - rvm: 1.8.7
|
||||
# - ree
|
||||
# - jruby-18mode
|
||||
# - rvm: 1.9.2
|
||||
- rvm: 1.9.3
|
||||
env: RAILS_VERSION=master
|
||||
- rvm: jruby-19mode
|
||||
env: RAILS_VERSION=master
|
||||
- rvm: 2.0.0
|
||||
env: RAILS_VERSION=master
|
||||
- rvm: 2.1
|
||||
env: RAILS_VERSION=master
|
||||
- rvm: 2.2
|
||||
env: RAILS_VERSION=master
|
||||
- rvm: rbx-2
|
||||
env: RAILS_VERSION=master
|
||||
fast_finish: true
|
||||
|
||||
29
Gemfile
29
Gemfile
@ -2,3 +2,32 @@ source 'https://rubygems.org'
|
||||
|
||||
# Specify gem dependencies in active_model_serializers.gemspec
|
||||
gemspec
|
||||
|
||||
version = ENV['RAILS_VERSION'] || '4.0'
|
||||
|
||||
if version == 'master'
|
||||
gem 'rack', github: 'rack/rack'
|
||||
gem 'arel', github: 'rails/arel'
|
||||
git 'https://github.com/rails/rails.git' do
|
||||
gem 'railties'
|
||||
gem 'activesupport'
|
||||
gem 'activemodel'
|
||||
gem 'actionpack'
|
||||
gem 'activerecord', group: :test
|
||||
# Rails 5
|
||||
gem 'actionview'
|
||||
end
|
||||
else
|
||||
gem_version = "~> #{version}.0"
|
||||
gem 'railties', gem_version
|
||||
gem 'activesupport', gem_version
|
||||
gem 'activemodel', gem_version
|
||||
gem 'actionpack', gem_version
|
||||
gem 'activerecord', gem_version, group: :test
|
||||
end
|
||||
|
||||
# https://github.com/bundler/bundler/blob/89a8778c19269561926cea172acdcda241d26d23/lib/bundler/dependency.rb#L30-L54
|
||||
@windows_platforms = [:mswin, :mingw, :x64_mingw]
|
||||
|
||||
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
||||
gem 'tzinfo-data', platforms: (@windows_platforms + [:jruby])
|
||||
|
||||
@ -1,9 +0,0 @@
|
||||
source 'http://rubygems.org'
|
||||
|
||||
gemspec
|
||||
|
||||
gem 'rails', github: 'rails/rails'
|
||||
|
||||
# Current dependencies of edge rails
|
||||
gem 'journey', github: 'rails/journey'
|
||||
gem 'activerecord-deprecated_finders' , github: 'rails/activerecord-deprecated_finders'
|
||||
1
Rakefile
1
Rakefile
@ -7,6 +7,7 @@ Rake::TestTask.new(:test) do |t|
|
||||
t.libs << 'lib'
|
||||
t.libs << 'test'
|
||||
t.pattern = 'test/**/*_test.rb'
|
||||
t.ruby_opts = ['-r./test/test_helper.rb']
|
||||
t.verbose = true
|
||||
end
|
||||
|
||||
|
||||
@ -4,8 +4,6 @@ skip_tags: true
|
||||
|
||||
environment:
|
||||
matrix:
|
||||
- ruby_version: "193"
|
||||
- ruby_version: "193-x64"
|
||||
- ruby_version: "200"
|
||||
- ruby_version: "200-x64"
|
||||
- ruby_version: "21"
|
||||
|
||||
@ -1,13 +1,36 @@
|
||||
require "rubygems"
|
||||
require "bundler/setup"
|
||||
|
||||
require 'rails'
|
||||
require 'action_controller'
|
||||
require 'action_controller/test_case'
|
||||
require 'action_controller/railtie'
|
||||
require 'active_support/json'
|
||||
|
||||
gem 'minitest'
|
||||
require 'minitest/autorun'
|
||||
if defined?(Minitest::Test)
|
||||
$minitest_version = 5 # rubocop:disable Style/GlobalVars
|
||||
# Minitest 5
|
||||
# https://github.com/seattlerb/minitest/blob/e21fdda9d/lib/minitest/autorun.rb
|
||||
# https://github.com/seattlerb/minitest/blob/e21fdda9d/lib/minitest.rb#L45-L59
|
||||
else
|
||||
$minitest_version = 4 # rubocop:disable Style/GlobalVars
|
||||
# Minitest 4
|
||||
# https://github.com/seattlerb/minitest/blob/644a52fd0/lib/minitest/autorun.rb
|
||||
# https://github.com/seattlerb/minitest/blob/644a52fd0/lib/minitest/unit.rb#L768-L787
|
||||
# Ensure backward compatibility with Minitest 4
|
||||
Minitest = MiniTest unless defined?(Minitest)
|
||||
Minitest::Test = MiniTest::Unit::TestCase
|
||||
def Minitest.after_run(&block)
|
||||
MiniTest::Unit.after_tests(&block)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
require "pry"
|
||||
|
||||
require "active_model_serializers"
|
||||
require "active_support/json"
|
||||
require "minitest/autorun"
|
||||
|
||||
require 'rails'
|
||||
|
||||
module TestHelper
|
||||
Routes = ActionDispatch::Routing::RouteSet.new
|
||||
|
||||
Loading…
Reference in New Issue
Block a user