From 9586ec87f888b6f236e1a15ca844ac39a0b82603 Mon Sep 17 00:00:00 2001 From: Tim Masliuchenko Date: Tue, 21 Mar 2017 10:43:22 +0200 Subject: [PATCH] Improve test suite (#81) --- .gitignore | 1 + .travis.yml | 23 +++++++++++-- Gemfile | 2 +- Gemfile.lock | 43 +++++++++++------------- Rakefile | 2 +- gemfiles/Gemfile.rails_3 | 4 +-- gemfiles/Gemfile.rails_3.lock | 34 +++++++++---------- gemfiles/Gemfile.rails_4 | 4 +-- gemfiles/Gemfile.rails_4.lock | 38 ++++++++++----------- gemfiles/Gemfile.rails_5 | 13 ++++++++ gemfiles/Gemfile.rails_5.lock | 53 ++++++++++++++++++++++++++++++ gemfiles/Gemfile.rails_master | 4 +-- gemfiles/Gemfile.rails_master.lock | 44 ++++++++++++------------- test/test_helper.rb | 2 +- 14 files changed, 174 insertions(+), 93 deletions(-) create mode 100644 gemfiles/Gemfile.rails_5 create mode 100644 gemfiles/Gemfile.rails_5.lock diff --git a/.gitignore b/.gitignore index cace5e84..d9ada38c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /pkg/ +.ruby-version diff --git a/.travis.yml b/.travis.yml index 383d6d78..874ba848 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,17 +19,36 @@ rvm: - 1.9.3 - 2.1 - 2.2 + - 2.3 gemfile: - Gemfile - gemfiles/Gemfile.rails_3 - gemfiles/Gemfile.rails_4 + - gemfiles/Gemfile.rails_5 - gemfiles/Gemfile.rails_master env: - PG_USER=postgres matrix: - allow_failures: - - rvm: 2.2 fast_finish: true + exclude: + - rvm: 1.9.3 + gemfile: Gemfile + - rvm: 2.1 + gemfile: Gemfile + - rvm: 2.2 + gemfile: Gemfile + - rvm: 1.9.3 + gemfile: gemfiles/Gemfile.rails_5 + - rvm: 2.1 + gemfile: gemfiles/Gemfile.rails_5 + - rvm: 2.2 + gemfile: gemfiles/Gemfile.rails_5 + - rvm: 1.9.3 + gemfile: gemfiles/Gemfile.rails_master + - rvm: 2.1 + gemfile: gemfiles/Gemfile.rails_master + - rvm: 2.2 + gemfile: gemfiles/Gemfile.rails_master diff --git a/Gemfile b/Gemfile index efa1afcd..0cdf6ff6 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ gemspec gem 'activerecord' gem 'sqlite3' -gem 'mysql' +gem 'mysql2' gem 'pg' gem 'minitest' diff --git a/Gemfile.lock b/Gemfile.lock index 9ec9b756..d338c369 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -7,33 +7,30 @@ PATH GEM remote: https://rubygems.org/ specs: - activemodel (4.2.5.1) - activesupport (= 4.2.5.1) - builder (~> 3.1) - activerecord (4.2.5.1) - activemodel (= 4.2.5.1) - activesupport (= 4.2.5.1) - arel (~> 6.0) - activesupport (4.2.5.1) + activemodel (5.0.2) + activesupport (= 5.0.2) + activerecord (5.0.2) + activemodel (= 5.0.2) + activesupport (= 5.0.2) + arel (~> 7.0) + activesupport (5.0.2) + concurrent-ruby (~> 1.0, >= 1.0.2) i18n (~> 0.7) - json (~> 1.7, >= 1.7.7) minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - arel (6.0.3) - builder (3.2.2) - i18n (0.7.0) - json (1.8.3) + arel (7.1.4) + concurrent-ruby (1.0.5) + i18n (0.8.1) metaclass (0.0.4) - minitest (5.8.4) - mocha (1.1.0) + minitest (5.10.1) + mocha (1.2.1) metaclass (~> 0.0.1) - mysql (2.9.1) - pg (0.18.4) - rake (11.1.1) - sqlite3 (1.3.11) + mysql2 (0.4.5) + pg (0.20.0) + rake (12.0.0) + sqlite3 (1.3.13) test_declarative (0.0.5) - thread_safe (0.3.5) + thread_safe (0.3.6) tzinfo (1.2.2) thread_safe (~> 0.1) @@ -46,11 +43,11 @@ DEPENDENCIES i18n-active_record! minitest mocha - mysql + mysql2 pg rake sqlite3 test_declarative BUNDLED WITH - 1.11.2 + 1.14.3 diff --git a/Rakefile b/Rakefile index 68afe824..3e36f71d 100644 --- a/Rakefile +++ b/Rakefile @@ -34,7 +34,7 @@ namespace :bundle do end task :install_all do - [nil, '3', '4', 'master'].each do |ar| + [nil, '3', '4', '5', 'master'].each do |ar| opt = ar && "AR=#{ar}" execute "rake bundle:install #{opt}" end diff --git a/gemfiles/Gemfile.rails_3 b/gemfiles/Gemfile.rails_3 index 20a7c8f0..fbb82cfc 100644 --- a/gemfiles/Gemfile.rails_3 +++ b/gemfiles/Gemfile.rails_3 @@ -4,8 +4,8 @@ gemspec path: '..' gem 'activerecord', '~> 3.2.0' gem 'sqlite3' -gem 'mysql' -gem 'pg' +gem 'mysql2' +gem 'pg', '~> 0.18.0' gem 'minitest' gem 'test_declarative' diff --git a/gemfiles/Gemfile.rails_3.lock b/gemfiles/Gemfile.rails_3.lock index ccb18c0c..ab5b0cc3 100644 --- a/gemfiles/Gemfile.rails_3.lock +++ b/gemfiles/Gemfile.rails_3.lock @@ -7,31 +7,31 @@ PATH GEM remote: https://rubygems.org/ specs: - activemodel (3.2.22.2) - activesupport (= 3.2.22.2) + activemodel (3.2.22.5) + activesupport (= 3.2.22.5) builder (~> 3.0.0) - activerecord (3.2.22.2) - activemodel (= 3.2.22.2) - activesupport (= 3.2.22.2) + activerecord (3.2.22.5) + activemodel (= 3.2.22.5) + activesupport (= 3.2.22.5) arel (~> 3.0.2) tzinfo (~> 0.3.29) - activesupport (3.2.22.2) + activesupport (3.2.22.5) i18n (~> 0.6, >= 0.6.4) multi_json (~> 1.0) arel (3.0.3) builder (3.0.4) - i18n (0.7.0) + i18n (0.8.1) metaclass (0.0.4) - minitest (5.8.4) - mocha (1.1.0) + minitest (5.10.1) + mocha (1.2.1) metaclass (~> 0.0.1) - multi_json (1.11.2) - mysql (2.9.1) + multi_json (1.12.1) + mysql2 (0.4.5) pg (0.18.4) - rake (11.1.1) - sqlite3 (1.3.11) + rake (12.0.0) + sqlite3 (1.3.13) test_declarative (0.0.5) - tzinfo (0.3.46) + tzinfo (0.3.52) PLATFORMS ruby @@ -42,11 +42,11 @@ DEPENDENCIES i18n-active_record! minitest mocha - mysql - pg + mysql2 + pg (~> 0.18.0) rake sqlite3 test_declarative BUNDLED WITH - 1.11.2 + 1.14.3 diff --git a/gemfiles/Gemfile.rails_4 b/gemfiles/Gemfile.rails_4 index a3574712..772435c9 100644 --- a/gemfiles/Gemfile.rails_4 +++ b/gemfiles/Gemfile.rails_4 @@ -4,8 +4,8 @@ gemspec path: '..' gem 'activerecord', '~> 4.2.0' gem 'sqlite3' -gem 'mysql' -gem 'pg' +gem 'mysql2' +gem 'pg', '~> 0.18.0' gem 'minitest' gem 'test_declarative' diff --git a/gemfiles/Gemfile.rails_4.lock b/gemfiles/Gemfile.rails_4.lock index 1ff996ce..13566207 100644 --- a/gemfiles/Gemfile.rails_4.lock +++ b/gemfiles/Gemfile.rails_4.lock @@ -7,33 +7,31 @@ PATH GEM remote: https://rubygems.org/ specs: - activemodel (4.2.5.2) - activesupport (= 4.2.5.2) + activemodel (4.2.8) + activesupport (= 4.2.8) builder (~> 3.1) - activerecord (4.2.5.2) - activemodel (= 4.2.5.2) - activesupport (= 4.2.5.2) + activerecord (4.2.8) + activemodel (= 4.2.8) + activesupport (= 4.2.8) arel (~> 6.0) - activesupport (4.2.5.2) + activesupport (4.2.8) i18n (~> 0.7) - json (~> 1.7, >= 1.7.7) minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - arel (6.0.3) - builder (3.2.2) - i18n (0.7.0) - json (1.8.3) + arel (6.0.4) + builder (3.2.3) + i18n (0.8.1) metaclass (0.0.4) - minitest (5.8.4) - mocha (1.1.0) + minitest (5.10.1) + mocha (1.2.1) metaclass (~> 0.0.1) - mysql (2.9.1) + mysql2 (0.4.5) pg (0.18.4) - rake (11.1.1) - sqlite3 (1.3.11) + rake (12.0.0) + sqlite3 (1.3.13) test_declarative (0.0.5) - thread_safe (0.3.5) + thread_safe (0.3.6) tzinfo (1.2.2) thread_safe (~> 0.1) @@ -46,11 +44,11 @@ DEPENDENCIES i18n-active_record! minitest mocha - mysql - pg + mysql2 + pg (~> 0.18.0) rake sqlite3 test_declarative BUNDLED WITH - 1.11.2 + 1.14.3 diff --git a/gemfiles/Gemfile.rails_5 b/gemfiles/Gemfile.rails_5 new file mode 100644 index 00000000..8c0ce253 --- /dev/null +++ b/gemfiles/Gemfile.rails_5 @@ -0,0 +1,13 @@ +source 'https://rubygems.org' + +gemspec path: '..' + +gem 'activerecord', '~> 5.0.0' +gem 'sqlite3' +gem 'mysql2' +gem 'pg' + +gem 'minitest' +gem 'test_declarative' +gem 'mocha' +gem 'rake' diff --git a/gemfiles/Gemfile.rails_5.lock b/gemfiles/Gemfile.rails_5.lock new file mode 100644 index 00000000..064ea32e --- /dev/null +++ b/gemfiles/Gemfile.rails_5.lock @@ -0,0 +1,53 @@ +PATH + remote: .. + specs: + i18n-active_record (0.1.2) + i18n (>= 0.5.0) + +GEM + remote: https://rubygems.org/ + specs: + activemodel (5.0.2) + activesupport (= 5.0.2) + activerecord (5.0.2) + activemodel (= 5.0.2) + activesupport (= 5.0.2) + arel (~> 7.0) + activesupport (5.0.2) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (~> 0.7) + minitest (~> 5.1) + tzinfo (~> 1.1) + arel (7.1.4) + concurrent-ruby (1.0.5) + i18n (0.8.1) + metaclass (0.0.4) + minitest (5.10.1) + mocha (1.2.1) + metaclass (~> 0.0.1) + mysql2 (0.4.5) + pg (0.20.0) + rake (12.0.0) + sqlite3 (1.3.13) + test_declarative (0.0.5) + thread_safe (0.3.6) + tzinfo (1.2.2) + thread_safe (~> 0.1) + +PLATFORMS + ruby + +DEPENDENCIES + activerecord (~> 5.0.0) + bundler + i18n-active_record! + minitest + mocha + mysql2 + pg + rake + sqlite3 + test_declarative + +BUNDLED WITH + 1.14.3 diff --git a/gemfiles/Gemfile.rails_master b/gemfiles/Gemfile.rails_master index 13780a1b..568a3d4c 100644 --- a/gemfiles/Gemfile.rails_master +++ b/gemfiles/Gemfile.rails_master @@ -2,9 +2,9 @@ source 'https://rubygems.org' gemspec path: '..' -gem 'activerecord', github: 'rails/rails', branch: 'master' +gem 'activerecord', git: 'https://github.com/rails/rails', branch: 'master' gem 'sqlite3' -gem 'mysql' +gem 'mysql2' gem 'pg' gem 'minitest' diff --git a/gemfiles/Gemfile.rails_master.lock b/gemfiles/Gemfile.rails_master.lock index e67ddea8..2280f018 100644 --- a/gemfiles/Gemfile.rails_master.lock +++ b/gemfiles/Gemfile.rails_master.lock @@ -1,16 +1,16 @@ GIT - remote: git://github.com/rails/rails.git - revision: d150f59f114dc2d362b9d8f96df88ca4fea09dc4 + remote: https://github.com/rails/rails + revision: cd3c0357d7ca7574f5a15a1229d25417a93a0a06 branch: master specs: - activemodel (5.0.0.beta3) - activesupport (= 5.0.0.beta3) - activerecord (5.0.0.beta3) - activemodel (= 5.0.0.beta3) - activesupport (= 5.0.0.beta3) - arel (~> 7.0) - activesupport (5.0.0.beta3) - concurrent-ruby (~> 1.0) + activemodel (5.1.0.beta1) + activesupport (= 5.1.0.beta1) + activerecord (5.1.0.beta1) + activemodel (= 5.1.0.beta1) + activesupport (= 5.1.0.beta1) + arel (~> 8.0) + activesupport (5.1.0.beta1) + concurrent-ruby (~> 1.0, >= 1.0.2) i18n (~> 0.7) minitest (~> 5.1) tzinfo (~> 1.1) @@ -24,19 +24,19 @@ PATH GEM remote: https://rubygems.org/ specs: - arel (7.0.0) - concurrent-ruby (1.0.1) - i18n (0.7.0) + arel (8.0.0) + concurrent-ruby (1.0.5) + i18n (0.8.1) metaclass (0.0.4) - minitest (5.8.4) - mocha (1.1.0) + minitest (5.10.1) + mocha (1.2.1) metaclass (~> 0.0.1) - mysql (2.9.1) - pg (0.18.4) - rake (11.1.1) - sqlite3 (1.3.11) + mysql2 (0.4.5) + pg (0.20.0) + rake (12.0.0) + sqlite3 (1.3.13) test_declarative (0.0.5) - thread_safe (0.3.5) + thread_safe (0.3.6) tzinfo (1.2.2) thread_safe (~> 0.1) @@ -49,11 +49,11 @@ DEPENDENCIES i18n-active_record! minitest mocha - mysql + mysql2 pg rake sqlite3 test_declarative BUNDLED WITH - 1.11.2 + 1.14.3 diff --git a/test/test_helper.rb b/test/test_helper.rb index 43a3f8bd..6104d150 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -19,7 +19,7 @@ when 'postgres' ::ActiveRecord::Base.establish_connection adapter: 'postgresql', database: 'i18n_unittest', username: ENV['PG_USER'] || 'i18n', password: '', host: 'localhost' when 'mysql' - ::ActiveRecord::Base.establish_connection adapter: 'mysql', database: 'i18n_unittest', username: 'root', password: '', host: 'localhost' + ::ActiveRecord::Base.establish_connection adapter: 'mysql2', database: 'i18n_unittest', username: 'root', password: '', host: 'localhost' else ::ActiveRecord::Base.establish_connection adapter: 'sqlite3', database: ':memory:' end