diff --git a/.travis.yml b/.travis.yml index 17411765d..c3b4cfbb9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,12 +8,14 @@ env: - DATABASE_ADAPTER=postgresql rvm: - - 2.0 - - 2.1 - - 2.2 + - 2.4.1 + - 2.3.4 + - 2.2.7 gemfile: - - gemfiles/4.0.0.gemfile - - gemfiles/4.0.1.gemfile - - gemfiles/4.1.gemfile - gemfiles/4.2.gemfile + - gemfiles/5.0.gemfile + +matrix: + allow_failures: + - gemfile: gemfiles/5.0.gemfile diff --git a/Appraisals b/Appraisals index ab0126d87..7646495ba 100644 --- a/Appraisals +++ b/Appraisals @@ -1,7 +1,5 @@ -ruby_version = Gem::Version.new(RUBY_VERSION + '') - shared_dependencies = proc do - gem 'rspec-rails', '>= 3.2.0', '< 4' + gem 'rspec-rails', '~> 3.6' gem 'shoulda-context', '~> 1.2.0' gem 'sqlite3', platform: :ruby gem 'pg', platform: :ruby @@ -17,57 +15,39 @@ spring = proc do gem 'spring-commands-rspec' end -rails_4 = proc do +appraise '4.2' do instance_eval(&shared_dependencies) instance_eval(&spring) gem 'uglifier', '>= 1.3.0' - gem 'coffee-rails', '~> 4.0.0' gem 'jquery-rails' - gem 'turbolinks' + gem 'turbolinks', '2.5.3' gem 'sdoc' + gem 'json', '~> 1.4' gem 'activeresource', '4.0.0' - # Test suite makes heavy use of attr_accessible gem 'protected_attributes' gem 'minitest-reporters' -end - -#--- - -appraise '4.0.0' do - instance_eval(&rails_4) - gem 'rails', '4.0.0' - gem 'jbuilder', '~> 1.2' - gem 'sass-rails', '~> 4.0.0' - gem 'bcrypt-ruby', '~> 3.0.0' -end - -appraise '4.0.1' do - instance_eval(&rails_4) - gem 'rails', '4.0.1' - gem 'jbuilder', '~> 1.2' - gem 'sass-rails', '~> 4.0.0' - gem 'bcrypt-ruby', '~> 3.1.2' -end - -appraise '4.1' do - instance_eval(&rails_4) - gem 'rails', '~> 4.1.0' + gem 'rails', '~> 4.2.9' + gem 'sass-rails', '~> 5.0' + gem 'coffee-rails', '~> 4.1.0' gem 'jbuilder', '~> 2.0' - gem 'sass-rails', '~> 4.0.3' - gem 'sdoc', '~> 0.4.0' + gem 'nokogiri', '~> 1.8' gem 'bcrypt', '~> 3.1.7' gem 'protected_attributes', "~> 1.0.6" - gem 'spring' end -appraise '4.2' do - instance_eval(&rails_4) - gem 'rails', '~> 4.2.0' +appraise '5.0' do + instance_eval(&shared_dependencies) + instance_eval(&spring) + gem 'rails', '~> 5.0.4' + gem 'rails-controller-testing', '>= 1.0.1' + gem 'puma', '~> 3.0' gem 'sass-rails', '~> 5.0' - gem 'coffee-rails', '~> 4.1.0' - gem 'jbuilder', '~> 2.0' - gem 'sdoc', '~> 0.4.0' + gem 'jquery-rails' + gem 'turbolinks', '~> 5' + gem 'jbuilder', '~> 2.5' gem 'bcrypt', '~> 3.1.7' - gem 'spring' - gem 'protected_attributes', "~> 1.0.6" + gem 'listen', '~> 3.0.5' + gem 'spring-watcher-listen', '~> 2.0.0' + gem 'nokogiri', '~> 1.8' + gem 'minitest-reporters' end diff --git a/Gemfile b/Gemfile index c2d49bf05..c410569ab 100644 --- a/Gemfile +++ b/Gemfile @@ -1,12 +1,12 @@ source 'https://rubygems.org' -gem 'appraisal', '~> 2.0' +gem 'appraisal', '2.1.0' gem 'bundler', '~> 1.1' -gem 'pry', git: 'https://github.com/pry/pry.git' +gem 'pry' gem 'pry-byebug' gem 'rake', '>= 10.5.0', '< 11' -gem 'rspec', '~> 3.2' -gem 'zeus' +gem 'rspec', '~> 3.6' +gem 'zeus', require: false # YARD gem 'yard' diff --git a/Gemfile.lock b/Gemfile.lock index d0259aa47..c797456c8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,11 +1,3 @@ -GIT - remote: https://github.com/pry/pry.git - revision: 1f64463184e0a160d0b41d1a1f92b8e2f230278c - specs: - pry (0.10.4) - coderay (~> 1.1.0) - method_source (~> 0.8.1) - GEM remote: https://rubygems.org/ specs: @@ -15,10 +7,14 @@ GEM thor (>= 0.14.0) byebug (9.0.6) coderay (1.1.1) - diff-lcs (1.2.5) + diff-lcs (1.3) fssm (0.2.10) method_source (0.8.2) multi_json (1.12.1) + pry (0.10.4) + coderay (~> 1.1.0) + method_source (~> 0.8.1) + slop (~> 3.4) pry-byebug (3.4.2) byebug (~> 9.0) pry (~> 0.10) @@ -26,39 +22,40 @@ GEM multi_json (>= 1.0.0) rake (10.5.0) redcarpet (3.4.0) - rspec (3.5.0) - rspec-core (~> 3.5.0) - rspec-expectations (~> 3.5.0) - rspec-mocks (~> 3.5.0) - rspec-core (3.5.4) - rspec-support (~> 3.5.0) - rspec-expectations (3.5.0) + rspec (3.6.0) + rspec-core (~> 3.6.0) + rspec-expectations (~> 3.6.0) + rspec-mocks (~> 3.6.0) + rspec-core (3.6.0) + rspec-support (~> 3.6.0) + rspec-expectations (3.6.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.5.0) - rspec-mocks (3.5.0) + rspec-support (~> 3.6.0) + rspec-mocks (3.6.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.5.0) - rspec-support (3.5.0) + rspec-support (~> 3.6.0) + rspec-support (3.6.0) + slop (3.6.0) thor (0.19.4) yard (0.9.6) - zeus (0.15.12) + zeus (0.15.14) method_source (>= 0.6.7) PLATFORMS ruby DEPENDENCIES - appraisal (~> 2.0) + appraisal (= 2.1.0) bundler (~> 1.1) fssm - pry! + pry pry-byebug pygments.rb rake (>= 10.5.0, < 11) redcarpet - rspec (~> 3.2) + rspec (~> 3.6) yard zeus BUNDLED WITH - 1.13.6 + 1.14.6 diff --git a/gemfiles/4.0.0.gemfile b/gemfiles/4.0.0.gemfile deleted file mode 100644 index affd5a69f..000000000 --- a/gemfiles/4.0.0.gemfile +++ /dev/null @@ -1,38 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "appraisal", "~> 2.0" -gem "bundler", "~> 1.1" -gem "pry", :github => "pry/pry" -gem "pry-byebug" -gem "rake", ">= 10.5.0", "< 11" -gem "rspec", "~> 3.2" -gem "zeus" -gem "yard" -gem "redcarpet" -gem "pygments.rb" -gem "fssm" -gem "rspec-rails", ">= 3.2.0", "< 4" -gem "shoulda-context", "~> 1.2.0" -gem "sqlite3", :platform => :ruby -gem "pg", :platform => :ruby -gem "activerecord-jdbc-adapter", :platform => :jruby -gem "activerecord-jdbcsqlite3-adapter", :platform => :jruby -gem "jdbc-sqlite3", :platform => :jruby -gem "jruby-openssl", :platform => :jruby -gem "therubyrhino", :platform => :jruby -gem "spring" -gem "spring-commands-rspec" -gem "uglifier", ">= 1.3.0" -gem "coffee-rails", "~> 4.0.0" -gem "jquery-rails" -gem "turbolinks" -gem "sdoc" -gem "activeresource", "4.0.0" -gem "protected_attributes" -gem "minitest-reporters" -gem "rails", "4.0.0" -gem "jbuilder", "~> 1.2" -gem "sass-rails", "~> 4.0.0" -gem "bcrypt-ruby", "~> 3.0.0" diff --git a/gemfiles/4.0.0.gemfile.lock b/gemfiles/4.0.0.gemfile.lock deleted file mode 100644 index 29e44455f..000000000 --- a/gemfiles/4.0.0.gemfile.lock +++ /dev/null @@ -1,223 +0,0 @@ -GIT - remote: git://github.com/pry/pry.git - revision: 3c138cbf94a44f7a6696afdab1ab5149d7541974 - specs: - pry (0.10.1) - coderay (~> 1.1.0) - method_source (~> 0.8.1) - slop (~> 3.4) - -GEM - remote: https://rubygems.org/ - specs: - actionmailer (4.0.0) - actionpack (= 4.0.0) - mail (~> 2.5.3) - actionpack (4.0.0) - activesupport (= 4.0.0) - builder (~> 3.1.0) - erubis (~> 2.7.0) - rack (~> 1.5.2) - rack-test (~> 0.6.2) - activemodel (4.0.0) - activesupport (= 4.0.0) - builder (~> 3.1.0) - activerecord (4.0.0) - activemodel (= 4.0.0) - activerecord-deprecated_finders (~> 1.0.2) - activesupport (= 4.0.0) - arel (~> 4.0.0) - activerecord-deprecated_finders (1.0.4) - activeresource (4.0.0) - activemodel (~> 4.0) - activesupport (~> 4.0) - rails-observers (~> 0.1.1) - activesupport (4.0.0) - i18n (~> 0.6, >= 0.6.4) - minitest (~> 4.2) - multi_json (~> 1.3) - thread_safe (~> 0.1) - tzinfo (~> 0.3.37) - ansi (1.5.0) - appraisal (2.1.0) - bundler - rake - thor (>= 0.14.0) - arel (4.0.2) - bcrypt-ruby (3.0.1) - builder (3.1.4) - byebug (5.0.0) - columnize (= 0.9.0) - coderay (1.1.0) - coffee-rails (4.0.1) - coffee-script (>= 2.2.0) - railties (>= 4.0.0, < 5.0) - coffee-script (2.4.1) - coffee-script-source - execjs - coffee-script-source (1.9.1.1) - columnize (0.9.0) - diff-lcs (1.2.5) - erubis (2.7.0) - execjs (2.6.0) - fssm (0.2.10) - hashie (3.4.2) - hike (1.2.3) - i18n (0.7.0) - jbuilder (1.5.3) - activesupport (>= 3.0.0) - multi_json (>= 1.2.0) - jquery-rails (3.1.4) - railties (>= 3.0, < 5.0) - thor (>= 0.14, < 2.0) - json (1.8.3) - mail (2.5.4) - mime-types (~> 1.16) - treetop (~> 1.4.8) - method_source (0.8.2) - mime-types (1.25.1) - minitest (4.7.5) - minitest-reporters (0.14.24) - ansi - builder - minitest (>= 2.12, < 5.0) - powerbar - multi_json (1.11.2) - pg (0.18.3) - polyglot (0.3.5) - posix-spawn (0.3.11) - powerbar (1.0.12) - ansi (~> 1.5.0) - hashie (>= 1.1.0) - protected_attributes (1.0.3) - activemodel (>= 4.0.0, < 5.0) - pry-byebug (3.2.0) - byebug (~> 5.0) - pry (~> 0.10) - pygments.rb (0.6.3) - posix-spawn (~> 0.3.6) - yajl-ruby (~> 1.2.0) - rack (1.5.5) - rack-test (0.6.3) - rack (>= 1.0) - rails (4.0.0) - actionmailer (= 4.0.0) - actionpack (= 4.0.0) - activerecord (= 4.0.0) - activesupport (= 4.0.0) - bundler (>= 1.3.0, < 2.0) - railties (= 4.0.0) - sprockets-rails (~> 2.0.0) - rails-observers (0.1.2) - activemodel (~> 4.0) - railties (4.0.0) - actionpack (= 4.0.0) - activesupport (= 4.0.0) - rake (>= 0.8.7) - thor (>= 0.18.1, < 2.0) - rake (10.5.0) - rdoc (4.2.0) - redcarpet (3.3.2) - rspec (3.4.0) - rspec-core (~> 3.4.0) - rspec-expectations (~> 3.4.0) - rspec-mocks (~> 3.4.0) - rspec-core (3.4.1) - rspec-support (~> 3.4.0) - rspec-expectations (3.4.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.4.0) - rspec-mocks (3.4.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.4.0) - rspec-rails (3.4.0) - actionpack (>= 3.0, < 4.3) - activesupport (>= 3.0, < 4.3) - railties (>= 3.0, < 4.3) - rspec-core (~> 3.4.0) - rspec-expectations (~> 3.4.0) - rspec-mocks (~> 3.4.0) - rspec-support (~> 3.4.0) - rspec-support (3.4.1) - sass (3.2.19) - sass-rails (4.0.5) - railties (>= 4.0.0, < 5.0) - sass (~> 3.2.2) - sprockets (~> 2.8, < 3.0) - sprockets-rails (~> 2.0) - sdoc (0.4.1) - json (~> 1.7, >= 1.7.7) - rdoc (~> 4.0) - shoulda-context (1.2.1) - slop (3.6.0) - spring (1.4.0) - spring-commands-rspec (1.0.4) - spring (>= 0.9.1) - sprockets (2.12.4) - hike (~> 1.2) - multi_json (~> 1.0) - rack (~> 1.0) - tilt (~> 1.1, != 1.3.0) - sprockets-rails (2.0.1) - actionpack (>= 3.0) - activesupport (>= 3.0) - sprockets (~> 2.8) - sqlite3 (1.3.10) - thor (0.19.1) - thread_safe (0.3.5) - tilt (1.4.1) - treetop (1.4.15) - polyglot - polyglot (>= 0.3.1) - turbolinks (2.5.3) - coffee-rails - tzinfo (0.3.46) - uglifier (2.7.2) - execjs (>= 0.3.0) - json (>= 1.8.0) - yajl-ruby (1.2.1) - yard (0.8.7.6) - zeus (0.15.4) - method_source (>= 0.6.7) - -PLATFORMS - ruby - -DEPENDENCIES - activerecord-jdbc-adapter - activerecord-jdbcsqlite3-adapter - activeresource (= 4.0.0) - appraisal (~> 2.0) - bcrypt-ruby (~> 3.0.0) - bundler (~> 1.1) - coffee-rails (~> 4.0.0) - fssm - jbuilder (~> 1.2) - jdbc-sqlite3 - jquery-rails - jruby-openssl - minitest-reporters - pg - protected_attributes - pry! - pry-byebug - pygments.rb - rails (= 4.0.0) - rake (>= 10.5.0, < 11) - redcarpet - rspec (~> 3.2) - rspec-rails (>= 3.2.0, < 4) - sass-rails (~> 4.0.0) - sdoc - shoulda-context (~> 1.2.0) - spring - spring-commands-rspec - sqlite3 - therubyrhino - turbolinks - uglifier (>= 1.3.0) - yard - zeus - -BUNDLED WITH - 1.11.2 diff --git a/gemfiles/4.0.1.gemfile b/gemfiles/4.0.1.gemfile deleted file mode 100644 index 7d56c6458..000000000 --- a/gemfiles/4.0.1.gemfile +++ /dev/null @@ -1,38 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "appraisal", "~> 2.0" -gem "bundler", "~> 1.1" -gem "pry", :github => "pry/pry" -gem "pry-byebug" -gem "rake", ">= 10.5.0", "< 11" -gem "rspec", "~> 3.2" -gem "zeus" -gem "yard" -gem "redcarpet" -gem "pygments.rb" -gem "fssm" -gem "rspec-rails", ">= 3.2.0", "< 4" -gem "shoulda-context", "~> 1.2.0" -gem "sqlite3", :platform => :ruby -gem "pg", :platform => :ruby -gem "activerecord-jdbc-adapter", :platform => :jruby -gem "activerecord-jdbcsqlite3-adapter", :platform => :jruby -gem "jdbc-sqlite3", :platform => :jruby -gem "jruby-openssl", :platform => :jruby -gem "therubyrhino", :platform => :jruby -gem "spring" -gem "spring-commands-rspec" -gem "uglifier", ">= 1.3.0" -gem "coffee-rails", "~> 4.0.0" -gem "jquery-rails" -gem "turbolinks" -gem "sdoc" -gem "activeresource", "4.0.0" -gem "protected_attributes" -gem "minitest-reporters" -gem "rails", "4.0.1" -gem "jbuilder", "~> 1.2" -gem "sass-rails", "~> 4.0.0" -gem "bcrypt-ruby", "~> 3.1.2" diff --git a/gemfiles/4.0.1.gemfile.lock b/gemfiles/4.0.1.gemfile.lock deleted file mode 100644 index e5d1eb969..000000000 --- a/gemfiles/4.0.1.gemfile.lock +++ /dev/null @@ -1,225 +0,0 @@ -GIT - remote: git://github.com/pry/pry.git - revision: 3c138cbf94a44f7a6696afdab1ab5149d7541974 - specs: - pry (0.10.1) - coderay (~> 1.1.0) - method_source (~> 0.8.1) - slop (~> 3.4) - -GEM - remote: https://rubygems.org/ - specs: - actionmailer (4.0.1) - actionpack (= 4.0.1) - mail (~> 2.5.4) - actionpack (4.0.1) - activesupport (= 4.0.1) - builder (~> 3.1.0) - erubis (~> 2.7.0) - rack (~> 1.5.2) - rack-test (~> 0.6.2) - activemodel (4.0.1) - activesupport (= 4.0.1) - builder (~> 3.1.0) - activerecord (4.0.1) - activemodel (= 4.0.1) - activerecord-deprecated_finders (~> 1.0.2) - activesupport (= 4.0.1) - arel (~> 4.0.0) - activerecord-deprecated_finders (1.0.4) - activeresource (4.0.0) - activemodel (~> 4.0) - activesupport (~> 4.0) - rails-observers (~> 0.1.1) - activesupport (4.0.1) - i18n (~> 0.6, >= 0.6.4) - minitest (~> 4.2) - multi_json (~> 1.3) - thread_safe (~> 0.1) - tzinfo (~> 0.3.37) - ansi (1.5.0) - appraisal (2.1.0) - bundler - rake - thor (>= 0.14.0) - arel (4.0.2) - bcrypt (3.1.10) - bcrypt-ruby (3.1.5) - bcrypt (>= 3.1.3) - builder (3.1.4) - byebug (5.0.0) - columnize (= 0.9.0) - coderay (1.1.0) - coffee-rails (4.0.1) - coffee-script (>= 2.2.0) - railties (>= 4.0.0, < 5.0) - coffee-script (2.4.1) - coffee-script-source - execjs - coffee-script-source (1.9.1.1) - columnize (0.9.0) - diff-lcs (1.2.5) - erubis (2.7.0) - execjs (2.6.0) - fssm (0.2.10) - hashie (3.4.2) - hike (1.2.3) - i18n (0.7.0) - jbuilder (1.5.3) - activesupport (>= 3.0.0) - multi_json (>= 1.2.0) - jquery-rails (3.1.4) - railties (>= 3.0, < 5.0) - thor (>= 0.14, < 2.0) - json (1.8.3) - mail (2.5.4) - mime-types (~> 1.16) - treetop (~> 1.4.8) - method_source (0.8.2) - mime-types (1.25.1) - minitest (4.7.5) - minitest-reporters (0.14.24) - ansi - builder - minitest (>= 2.12, < 5.0) - powerbar - multi_json (1.11.2) - pg (0.18.3) - polyglot (0.3.5) - posix-spawn (0.3.11) - powerbar (1.0.12) - ansi (~> 1.5.0) - hashie (>= 1.1.0) - protected_attributes (1.1.3) - activemodel (>= 4.0.1, < 5.0) - pry-byebug (3.2.0) - byebug (~> 5.0) - pry (~> 0.10) - pygments.rb (0.6.3) - posix-spawn (~> 0.3.6) - yajl-ruby (~> 1.2.0) - rack (1.5.5) - rack-test (0.6.3) - rack (>= 1.0) - rails (4.0.1) - actionmailer (= 4.0.1) - actionpack (= 4.0.1) - activerecord (= 4.0.1) - activesupport (= 4.0.1) - bundler (>= 1.3.0, < 2.0) - railties (= 4.0.1) - sprockets-rails (~> 2.0.0) - rails-observers (0.1.2) - activemodel (~> 4.0) - railties (4.0.1) - actionpack (= 4.0.1) - activesupport (= 4.0.1) - rake (>= 0.8.7) - thor (>= 0.18.1, < 2.0) - rake (10.5.0) - rdoc (4.2.0) - redcarpet (3.3.2) - rspec (3.4.0) - rspec-core (~> 3.4.0) - rspec-expectations (~> 3.4.0) - rspec-mocks (~> 3.4.0) - rspec-core (3.4.1) - rspec-support (~> 3.4.0) - rspec-expectations (3.4.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.4.0) - rspec-mocks (3.4.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.4.0) - rspec-rails (3.4.0) - actionpack (>= 3.0, < 4.3) - activesupport (>= 3.0, < 4.3) - railties (>= 3.0, < 4.3) - rspec-core (~> 3.4.0) - rspec-expectations (~> 3.4.0) - rspec-mocks (~> 3.4.0) - rspec-support (~> 3.4.0) - rspec-support (3.4.1) - sass (3.2.19) - sass-rails (4.0.5) - railties (>= 4.0.0, < 5.0) - sass (~> 3.2.2) - sprockets (~> 2.8, < 3.0) - sprockets-rails (~> 2.0) - sdoc (0.4.1) - json (~> 1.7, >= 1.7.7) - rdoc (~> 4.0) - shoulda-context (1.2.1) - slop (3.6.0) - spring (1.4.0) - spring-commands-rspec (1.0.4) - spring (>= 0.9.1) - sprockets (2.12.4) - hike (~> 1.2) - multi_json (~> 1.0) - rack (~> 1.0) - tilt (~> 1.1, != 1.3.0) - sprockets-rails (2.0.1) - actionpack (>= 3.0) - activesupport (>= 3.0) - sprockets (~> 2.8) - sqlite3 (1.3.10) - thor (0.19.1) - thread_safe (0.3.5) - tilt (1.4.1) - treetop (1.4.15) - polyglot - polyglot (>= 0.3.1) - turbolinks (2.5.3) - coffee-rails - tzinfo (0.3.46) - uglifier (2.7.2) - execjs (>= 0.3.0) - json (>= 1.8.0) - yajl-ruby (1.2.1) - yard (0.8.7.6) - zeus (0.15.4) - method_source (>= 0.6.7) - -PLATFORMS - ruby - -DEPENDENCIES - activerecord-jdbc-adapter - activerecord-jdbcsqlite3-adapter - activeresource (= 4.0.0) - appraisal (~> 2.0) - bcrypt-ruby (~> 3.1.2) - bundler (~> 1.1) - coffee-rails (~> 4.0.0) - fssm - jbuilder (~> 1.2) - jdbc-sqlite3 - jquery-rails - jruby-openssl - minitest-reporters - pg - protected_attributes - pry! - pry-byebug - pygments.rb - rails (= 4.0.1) - rake (>= 10.5.0, < 11) - redcarpet - rspec (~> 3.2) - rspec-rails (>= 3.2.0, < 4) - sass-rails (~> 4.0.0) - sdoc - shoulda-context (~> 1.2.0) - spring - spring-commands-rspec - sqlite3 - therubyrhino - turbolinks - uglifier (>= 1.3.0) - yard - zeus - -BUNDLED WITH - 1.11.2 diff --git a/gemfiles/4.1.gemfile.lock b/gemfiles/4.1.gemfile.lock deleted file mode 100644 index 539a39741..000000000 --- a/gemfiles/4.1.gemfile.lock +++ /dev/null @@ -1,220 +0,0 @@ -GIT - remote: git://github.com/pry/pry.git - revision: 3c138cbf94a44f7a6696afdab1ab5149d7541974 - specs: - pry (0.10.1) - coderay (~> 1.1.0) - method_source (~> 0.8.1) - slop (~> 3.4) - -GEM - remote: https://rubygems.org/ - specs: - actionmailer (4.1.13) - actionpack (= 4.1.13) - actionview (= 4.1.13) - mail (~> 2.5, >= 2.5.4) - actionpack (4.1.13) - actionview (= 4.1.13) - activesupport (= 4.1.13) - rack (~> 1.5.2) - rack-test (~> 0.6.2) - actionview (4.1.13) - activesupport (= 4.1.13) - builder (~> 3.1) - erubis (~> 2.7.0) - activemodel (4.1.13) - activesupport (= 4.1.13) - builder (~> 3.1) - activerecord (4.1.13) - activemodel (= 4.1.13) - activesupport (= 4.1.13) - arel (~> 5.0.0) - activeresource (4.0.0) - activemodel (~> 4.0) - activesupport (~> 4.0) - rails-observers (~> 0.1.1) - activesupport (4.1.13) - i18n (~> 0.6, >= 0.6.9) - json (~> 1.7, >= 1.7.7) - minitest (~> 5.1) - thread_safe (~> 0.1) - tzinfo (~> 1.1) - ansi (1.5.0) - appraisal (2.1.0) - bundler - rake - thor (>= 0.14.0) - arel (5.0.1.20140414130214) - bcrypt (3.1.10) - builder (3.2.2) - byebug (5.0.0) - columnize (= 0.9.0) - coderay (1.1.0) - coffee-rails (4.0.1) - coffee-script (>= 2.2.0) - railties (>= 4.0.0, < 5.0) - coffee-script (2.4.1) - coffee-script-source - execjs - coffee-script-source (1.9.1.1) - columnize (0.9.0) - diff-lcs (1.2.5) - erubis (2.7.0) - execjs (2.6.0) - fssm (0.2.10) - hike (1.2.3) - i18n (0.7.0) - jbuilder (2.3.1) - activesupport (>= 3.0.0, < 5) - multi_json (~> 1.2) - jquery-rails (3.1.4) - railties (>= 3.0, < 5.0) - thor (>= 0.14, < 2.0) - json (1.8.3) - mail (2.6.3) - mime-types (>= 1.16, < 3) - method_source (0.8.2) - mime-types (2.6.2) - minitest (5.8.3) - minitest-reporters (1.1.2) - ansi - builder - minitest (>= 5.0) - ruby-progressbar - multi_json (1.11.2) - pg (0.18.3) - posix-spawn (0.3.11) - protected_attributes (1.0.9) - activemodel (>= 4.0.1, < 5.0) - pry-byebug (3.2.0) - byebug (~> 5.0) - pry (~> 0.10) - pygments.rb (0.6.3) - posix-spawn (~> 0.3.6) - yajl-ruby (~> 1.2.0) - rack (1.5.5) - rack-test (0.6.3) - rack (>= 1.0) - rails (4.1.13) - actionmailer (= 4.1.13) - actionpack (= 4.1.13) - actionview (= 4.1.13) - activemodel (= 4.1.13) - activerecord (= 4.1.13) - activesupport (= 4.1.13) - bundler (>= 1.3.0, < 2.0) - railties (= 4.1.13) - sprockets-rails (~> 2.0) - rails-observers (0.1.2) - activemodel (~> 4.0) - railties (4.1.13) - actionpack (= 4.1.13) - activesupport (= 4.1.13) - rake (>= 0.8.7) - thor (>= 0.18.1, < 2.0) - rake (10.5.0) - rdoc (4.2.0) - redcarpet (3.3.2) - rspec (3.4.0) - rspec-core (~> 3.4.0) - rspec-expectations (~> 3.4.0) - rspec-mocks (~> 3.4.0) - rspec-core (3.4.1) - rspec-support (~> 3.4.0) - rspec-expectations (3.4.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.4.0) - rspec-mocks (3.4.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.4.0) - rspec-rails (3.4.0) - actionpack (>= 3.0, < 4.3) - activesupport (>= 3.0, < 4.3) - railties (>= 3.0, < 4.3) - rspec-core (~> 3.4.0) - rspec-expectations (~> 3.4.0) - rspec-mocks (~> 3.4.0) - rspec-support (~> 3.4.0) - rspec-support (3.4.1) - ruby-progressbar (1.7.5) - sass (3.2.19) - sass-rails (4.0.5) - railties (>= 4.0.0, < 5.0) - sass (~> 3.2.2) - sprockets (~> 2.8, < 3.0) - sprockets-rails (~> 2.0) - sdoc (0.4.1) - json (~> 1.7, >= 1.7.7) - rdoc (~> 4.0) - shoulda-context (1.2.1) - slop (3.6.0) - spring (1.4.0) - spring-commands-rspec (1.0.4) - spring (>= 0.9.1) - sprockets (2.12.4) - hike (~> 1.2) - multi_json (~> 1.0) - rack (~> 1.0) - tilt (~> 1.1, != 1.3.0) - sprockets-rails (2.3.3) - actionpack (>= 3.0) - activesupport (>= 3.0) - sprockets (>= 2.8, < 4.0) - sqlite3 (1.3.10) - thor (0.19.1) - thread_safe (0.3.5) - tilt (1.4.1) - turbolinks (2.5.3) - coffee-rails - tzinfo (1.2.2) - thread_safe (~> 0.1) - uglifier (2.7.2) - execjs (>= 0.3.0) - json (>= 1.8.0) - yajl-ruby (1.2.1) - yard (0.8.7.6) - zeus (0.15.4) - method_source (>= 0.6.7) - -PLATFORMS - ruby - -DEPENDENCIES - activerecord-jdbc-adapter - activerecord-jdbcsqlite3-adapter - activeresource (= 4.0.0) - appraisal (~> 2.0) - bcrypt (~> 3.1.7) - bundler (~> 1.1) - coffee-rails (~> 4.0.0) - fssm - jbuilder (~> 2.0) - jdbc-sqlite3 - jquery-rails - jruby-openssl - minitest-reporters - pg - protected_attributes (~> 1.0.6) - pry! - pry-byebug - pygments.rb - rails (~> 4.1.0) - rake (>= 10.5.0, < 11) - redcarpet - rspec (~> 3.2) - rspec-rails (>= 3.2.0, < 4) - sass-rails (~> 4.0.3) - sdoc (~> 0.4.0) - shoulda-context (~> 1.2.0) - spring - spring-commands-rspec - sqlite3 - therubyrhino - turbolinks - uglifier (>= 1.3.0) - yard - zeus - -BUNDLED WITH - 1.11.2 diff --git a/gemfiles/4.2.gemfile b/gemfiles/4.2.gemfile index eb197b40f..ace2c881d 100644 --- a/gemfiles/4.2.gemfile +++ b/gemfiles/4.2.gemfile @@ -2,18 +2,18 @@ source "https://rubygems.org" -gem "appraisal", "~> 2.0" +gem "appraisal", "2.1.0" gem "bundler", "~> 1.1" -gem "pry", :github => "pry/pry" +gem "pry" gem "pry-byebug" gem "rake", ">= 10.5.0", "< 11" -gem "rspec", "~> 3.2" -gem "zeus" +gem "rspec", "~> 3.6" +gem "zeus", :require => false gem "yard" gem "redcarpet" gem "pygments.rb" gem "fssm" -gem "rspec-rails", ">= 3.2.0", "< 4" +gem "rspec-rails", "~> 3.6" gem "shoulda-context", "~> 1.2.0" gem "sqlite3", :platform => :ruby gem "pg", :platform => :ruby @@ -25,14 +25,16 @@ gem "therubyrhino", :platform => :jruby gem "spring" gem "spring-commands-rspec" gem "uglifier", ">= 1.3.0" -gem "coffee-rails", "~> 4.1.0" gem "jquery-rails" -gem "turbolinks" -gem "sdoc", "~> 0.4.0" +gem "turbolinks", "2.5.3" +gem "sdoc" +gem "json", "~> 1.4" gem "activeresource", "4.0.0" gem "protected_attributes", "~> 1.0.6" gem "minitest-reporters" -gem "rails", "~> 4.2.0" +gem "rails", "~> 4.2.9" gem "sass-rails", "~> 5.0" +gem "coffee-rails", "~> 4.1.0" gem "jbuilder", "~> 2.0" +gem "nokogiri", "~> 1.8" gem "bcrypt", "~> 3.1.7" diff --git a/gemfiles/4.2.gemfile.lock b/gemfiles/4.2.gemfile.lock index 73845fe8d..0f460da2e 100644 --- a/gemfiles/4.2.gemfile.lock +++ b/gemfiles/4.2.gemfile.lock @@ -1,51 +1,41 @@ -GIT - remote: git://github.com/pry/pry.git - revision: 3c138cbf94a44f7a6696afdab1ab5149d7541974 - specs: - pry (0.10.1) - coderay (~> 1.1.0) - method_source (~> 0.8.1) - slop (~> 3.4) - GEM remote: https://rubygems.org/ specs: - actionmailer (4.2.4) - actionpack (= 4.2.4) - actionview (= 4.2.4) - activejob (= 4.2.4) + actionmailer (4.2.9) + actionpack (= 4.2.9) + actionview (= 4.2.9) + activejob (= 4.2.9) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 1.0, >= 1.0.5) - actionpack (4.2.4) - actionview (= 4.2.4) - activesupport (= 4.2.4) + actionpack (4.2.9) + actionview (= 4.2.9) + activesupport (= 4.2.9) rack (~> 1.6) rack-test (~> 0.6.2) rails-dom-testing (~> 1.0, >= 1.0.5) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (4.2.4) - activesupport (= 4.2.4) + actionview (4.2.9) + activesupport (= 4.2.9) builder (~> 3.1) erubis (~> 2.7.0) rails-dom-testing (~> 1.0, >= 1.0.5) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - activejob (4.2.4) - activesupport (= 4.2.4) + rails-html-sanitizer (~> 1.0, >= 1.0.3) + activejob (4.2.9) + activesupport (= 4.2.9) globalid (>= 0.3.0) - activemodel (4.2.4) - activesupport (= 4.2.4) + activemodel (4.2.9) + activesupport (= 4.2.9) builder (~> 3.1) - activerecord (4.2.4) - activemodel (= 4.2.4) - activesupport (= 4.2.4) + activerecord (4.2.9) + activemodel (= 4.2.9) + activesupport (= 4.2.9) arel (~> 6.0) activeresource (4.0.0) activemodel (~> 4.0) activesupport (~> 4.0) rails-observers (~> 0.1.1) - activesupport (4.2.4) + activesupport (4.2.9) i18n (~> 0.7) - json (~> 1.7, >= 1.7.7) minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) @@ -54,12 +44,11 @@ GEM bundler rake thor (>= 0.14.0) - arel (6.0.3) + arel (6.0.4) bcrypt (3.1.10) - builder (3.2.2) - byebug (5.0.0) - columnize (= 0.9.0) - coderay (1.1.0) + builder (3.2.3) + byebug (9.0.6) + coderay (1.1.1) coffee-rails (4.1.0) coffee-script (>= 2.2.0) railties (>= 4.0.0, < 5.0) @@ -67,101 +56,107 @@ GEM coffee-script-source execjs coffee-script-source (1.9.1.1) - columnize (0.9.0) - diff-lcs (1.2.5) + concurrent-ruby (1.0.5) + diff-lcs (1.3) erubis (2.7.0) execjs (2.6.0) fssm (0.2.10) - globalid (0.3.6) - activesupport (>= 4.1.0) - i18n (0.7.0) - jbuilder (2.3.1) - activesupport (>= 3.0.0, < 5) + globalid (0.4.0) + activesupport (>= 4.2.0) + i18n (0.8.6) + jbuilder (2.6.3) + activesupport (>= 3.0.0, < 5.2) multi_json (~> 1.2) jquery-rails (4.0.5) rails-dom-testing (~> 1.0) railties (>= 4.2.0) thor (>= 0.14, < 2.0) - json (1.8.3) + json (1.8.6) loofah (2.0.3) nokogiri (>= 1.5.9) - mail (2.6.3) - mime-types (>= 1.16, < 3) + mail (2.6.6) + mime-types (>= 1.16, < 4) method_source (0.8.2) - mime-types (2.6.2) - mini_portile2 (2.0.0) - minitest (5.8.3) + mime-types (3.1) + mime-types-data (~> 3.2015) + mime-types-data (3.2016.0521) + mini_portile2 (2.2.0) + minitest (5.10.3) minitest-reporters (1.1.2) ansi builder minitest (>= 5.0) ruby-progressbar - multi_json (1.11.2) - nokogiri (1.6.7.1) - mini_portile2 (~> 2.0.0.rc2) + multi_json (1.12.1) + nokogiri (1.8.0) + mini_portile2 (~> 2.2.0) pg (0.18.3) posix-spawn (0.3.11) protected_attributes (1.0.9) activemodel (>= 4.0.1, < 5.0) - pry-byebug (3.2.0) - byebug (~> 5.0) + pry (0.10.4) + coderay (~> 1.1.0) + method_source (~> 0.8.1) + slop (~> 3.4) + pry-byebug (3.4.2) + byebug (~> 9.0) pry (~> 0.10) pygments.rb (0.6.3) posix-spawn (~> 0.3.6) yajl-ruby (~> 1.2.0) - rack (1.6.4) + rack (1.6.8) rack-test (0.6.3) rack (>= 1.0) - rails (4.2.4) - actionmailer (= 4.2.4) - actionpack (= 4.2.4) - actionview (= 4.2.4) - activejob (= 4.2.4) - activemodel (= 4.2.4) - activerecord (= 4.2.4) - activesupport (= 4.2.4) + rails (4.2.9) + actionmailer (= 4.2.9) + actionpack (= 4.2.9) + actionview (= 4.2.9) + activejob (= 4.2.9) + activemodel (= 4.2.9) + activerecord (= 4.2.9) + activesupport (= 4.2.9) bundler (>= 1.3.0, < 2.0) - railties (= 4.2.4) + railties (= 4.2.9) sprockets-rails rails-deprecated_sanitizer (1.0.3) activesupport (>= 4.2.0.alpha) - rails-dom-testing (1.0.7) + rails-dom-testing (1.0.8) activesupport (>= 4.2.0.beta, < 5.0) - nokogiri (~> 1.6.0) + nokogiri (~> 1.6) rails-deprecated_sanitizer (>= 1.0.1) - rails-html-sanitizer (1.0.2) + rails-html-sanitizer (1.0.3) loofah (~> 2.0) rails-observers (0.1.2) activemodel (~> 4.0) - railties (4.2.4) - actionpack (= 4.2.4) - activesupport (= 4.2.4) + railties (4.2.9) + actionpack (= 4.2.9) + activesupport (= 4.2.9) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) rake (10.5.0) - rdoc (4.2.0) + rdoc (4.3.0) redcarpet (3.3.2) - rspec (3.4.0) - rspec-core (~> 3.4.0) - rspec-expectations (~> 3.4.0) - rspec-mocks (~> 3.4.0) - rspec-core (3.4.1) - rspec-support (~> 3.4.0) - rspec-expectations (3.4.0) + rspec (3.6.0) + rspec-core (~> 3.6.0) + rspec-expectations (~> 3.6.0) + rspec-mocks (~> 3.6.0) + rspec-core (3.6.0) + rspec-support (~> 3.6.0) + rspec-expectations (3.6.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.4.0) - rspec-mocks (3.4.0) + rspec-support (~> 3.6.0) + rspec-mocks (3.6.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.4.0) - rspec-rails (3.4.0) - actionpack (>= 3.0, < 4.3) - activesupport (>= 3.0, < 4.3) - railties (>= 3.0, < 4.3) - rspec-core (~> 3.4.0) - rspec-expectations (~> 3.4.0) - rspec-mocks (~> 3.4.0) - rspec-support (~> 3.4.0) - rspec-support (3.4.1) + rspec-support (~> 3.6.0) + rspec-rails (3.6.0) + actionpack (>= 3.0) + activesupport (>= 3.0) + railties (>= 3.0) + rspec-core (~> 3.6.0) + rspec-expectations (~> 3.6.0) + rspec-mocks (~> 3.6.0) + rspec-support (~> 3.6.0) + rspec-support (3.6.0) ruby-progressbar (1.7.5) sass (3.4.18) sass-rails (5.0.4) @@ -178,26 +173,27 @@ GEM spring (1.4.0) spring-commands-rspec (1.0.4) spring (>= 0.9.1) - sprockets (3.3.5) + sprockets (3.7.1) + concurrent-ruby (~> 1.0) rack (> 1, < 3) - sprockets-rails (2.3.3) - actionpack (>= 3.0) - activesupport (>= 3.0) - sprockets (>= 2.8, < 4.0) + sprockets-rails (3.2.0) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) sqlite3 (1.3.10) - thor (0.19.1) - thread_safe (0.3.5) + thor (0.19.4) + thread_safe (0.3.6) tilt (2.0.1) turbolinks (2.5.3) coffee-rails - tzinfo (1.2.2) + tzinfo (1.2.3) thread_safe (~> 0.1) uglifier (2.7.2) execjs (>= 0.3.0) json (>= 1.8.0) - yajl-ruby (1.2.1) + yajl-ruby (1.2.2) yard (0.8.7.6) - zeus (0.15.4) + zeus (0.15.14) method_source (>= 0.6.7) PLATFORMS @@ -207,7 +203,7 @@ DEPENDENCIES activerecord-jdbc-adapter activerecord-jdbcsqlite3-adapter activeresource (= 4.0.0) - appraisal (~> 2.0) + appraisal (= 2.1.0) bcrypt (~> 3.1.7) bundler (~> 1.1) coffee-rails (~> 4.1.0) @@ -216,28 +212,30 @@ DEPENDENCIES jdbc-sqlite3 jquery-rails jruby-openssl + json (~> 1.4) minitest-reporters + nokogiri (~> 1.8) pg protected_attributes (~> 1.0.6) - pry! + pry pry-byebug pygments.rb - rails (~> 4.2.0) + rails (~> 4.2.9) rake (>= 10.5.0, < 11) redcarpet - rspec (~> 3.2) - rspec-rails (>= 3.2.0, < 4) + rspec (~> 3.6) + rspec-rails (~> 3.6) sass-rails (~> 5.0) - sdoc (~> 0.4.0) + sdoc shoulda-context (~> 1.2.0) spring spring-commands-rspec sqlite3 therubyrhino - turbolinks + turbolinks (= 2.5.3) uglifier (>= 1.3.0) yard zeus BUNDLED WITH - 1.11.2 + 1.14.6 diff --git a/gemfiles/4.1.gemfile b/gemfiles/5.0.gemfile similarity index 63% rename from gemfiles/4.1.gemfile rename to gemfiles/5.0.gemfile index be5e7989c..37c13ddc4 100644 --- a/gemfiles/4.1.gemfile +++ b/gemfiles/5.0.gemfile @@ -2,18 +2,18 @@ source "https://rubygems.org" -gem "appraisal", "~> 2.0" +gem "appraisal", "2.1.0" gem "bundler", "~> 1.1" -gem "pry", :github => "pry/pry" +gem "pry" gem "pry-byebug" gem "rake", ">= 10.5.0", "< 11" -gem "rspec", "~> 3.2" -gem "zeus" +gem "rspec", "~> 3.6" +gem "zeus", :require => false gem "yard" gem "redcarpet" gem "pygments.rb" gem "fssm" -gem "rspec-rails", ">= 3.2.0", "< 4" +gem "rspec-rails", "~> 3.6" gem "shoulda-context", "~> 1.2.0" gem "sqlite3", :platform => :ruby gem "pg", :platform => :ruby @@ -24,15 +24,15 @@ gem "jruby-openssl", :platform => :jruby gem "therubyrhino", :platform => :jruby gem "spring" gem "spring-commands-rspec" -gem "uglifier", ">= 1.3.0" -gem "coffee-rails", "~> 4.0.0" +gem "rails", "~> 5.0.4" +gem "rails-controller-testing", ">= 1.0.1" +gem "puma", "~> 3.0" +gem "sass-rails", "~> 5.0" gem "jquery-rails" -gem "turbolinks" -gem "sdoc", "~> 0.4.0" -gem "activeresource", "4.0.0" -gem "protected_attributes", "~> 1.0.6" -gem "minitest-reporters" -gem "rails", "~> 4.1.0" -gem "jbuilder", "~> 2.0" -gem "sass-rails", "~> 4.0.3" +gem "turbolinks", "~> 5" +gem "jbuilder", "~> 2.5" gem "bcrypt", "~> 3.1.7" +gem "listen", "~> 3.0.5" +gem "spring-watcher-listen", "~> 2.0.0" +gem "nokogiri", "~> 1.8" +gem "minitest-reporters" diff --git a/gemfiles/5.0.gemfile.lock b/gemfiles/5.0.gemfile.lock new file mode 100644 index 000000000..adc9a22f0 --- /dev/null +++ b/gemfiles/5.0.gemfile.lock @@ -0,0 +1,241 @@ +GEM + remote: https://rubygems.org/ + specs: + actioncable (5.0.4) + actionpack (= 5.0.4) + nio4r (>= 1.2, < 3.0) + websocket-driver (~> 0.6.1) + actionmailer (5.0.4) + actionpack (= 5.0.4) + actionview (= 5.0.4) + activejob (= 5.0.4) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 2.0) + actionpack (5.0.4) + actionview (= 5.0.4) + activesupport (= 5.0.4) + rack (~> 2.0) + rack-test (~> 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (5.0.4) + activesupport (= 5.0.4) + builder (~> 3.1) + erubis (~> 2.7.0) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.3) + activejob (5.0.4) + activesupport (= 5.0.4) + globalid (>= 0.3.6) + activemodel (5.0.4) + activesupport (= 5.0.4) + activerecord (5.0.4) + activemodel (= 5.0.4) + activesupport (= 5.0.4) + arel (~> 7.0) + activesupport (5.0.4) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (~> 0.7) + minitest (~> 5.1) + tzinfo (~> 1.1) + ansi (1.5.0) + appraisal (2.1.0) + bundler + rake + thor (>= 0.14.0) + arel (7.1.4) + bcrypt (3.1.11) + builder (3.2.3) + byebug (9.0.6) + coderay (1.1.1) + concurrent-ruby (1.0.5) + diff-lcs (1.3) + erubis (2.7.0) + ffi (1.9.14) + fssm (0.2.10) + globalid (0.4.0) + activesupport (>= 4.2.0) + i18n (0.8.6) + jbuilder (2.6.3) + activesupport (>= 3.0.0, < 5.2) + multi_json (~> 1.2) + jquery-rails (4.3.1) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + listen (3.0.8) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + loofah (2.0.3) + nokogiri (>= 1.5.9) + mail (2.6.6) + mime-types (>= 1.16, < 4) + method_source (0.8.2) + mime-types (3.1) + mime-types-data (~> 3.2015) + mime-types-data (3.2016.0521) + mini_portile2 (2.2.0) + minitest (5.10.3) + minitest-reporters (1.1.14) + ansi + builder + minitest (>= 5.0) + ruby-progressbar + multi_json (1.12.1) + nio4r (2.1.0) + nokogiri (1.8.0) + mini_portile2 (~> 2.2.0) + pg (0.18.4) + posix-spawn (0.3.11) + pry (0.10.4) + coderay (~> 1.1.0) + method_source (~> 0.8.1) + slop (~> 3.4) + pry-byebug (3.4.2) + byebug (~> 9.0) + pry (~> 0.10) + puma (3.9.1) + pygments.rb (0.6.3) + posix-spawn (~> 0.3.6) + yajl-ruby (~> 1.2.0) + rack (2.0.3) + rack-test (0.6.3) + rack (>= 1.0) + rails (5.0.4) + actioncable (= 5.0.4) + actionmailer (= 5.0.4) + actionpack (= 5.0.4) + actionview (= 5.0.4) + activejob (= 5.0.4) + activemodel (= 5.0.4) + activerecord (= 5.0.4) + activesupport (= 5.0.4) + bundler (>= 1.3.0, < 2.0) + railties (= 5.0.4) + sprockets-rails (>= 2.0.0) + rails-controller-testing (1.0.1) + actionpack (~> 5.x) + actionview (~> 5.x) + activesupport (~> 5.x) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.0.3) + loofah (~> 2.0) + railties (5.0.4) + actionpack (= 5.0.4) + activesupport (= 5.0.4) + method_source + rake (>= 0.8.7) + thor (>= 0.18.1, < 2.0) + rake (10.5.0) + rb-fsevent (0.9.7) + rb-inotify (0.9.7) + ffi (>= 0.5.0) + redcarpet (3.3.4) + rspec (3.6.0) + rspec-core (~> 3.6.0) + rspec-expectations (~> 3.6.0) + rspec-mocks (~> 3.6.0) + rspec-core (3.6.0) + rspec-support (~> 3.6.0) + rspec-expectations (3.6.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.6.0) + rspec-mocks (3.6.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.6.0) + rspec-rails (3.6.0) + actionpack (>= 3.0) + activesupport (>= 3.0) + railties (>= 3.0) + rspec-core (~> 3.6.0) + rspec-expectations (~> 3.6.0) + rspec-mocks (~> 3.6.0) + rspec-support (~> 3.6.0) + rspec-support (3.6.0) + ruby-progressbar (1.8.1) + sass (3.5.1) + sass-listen (~> 4.0.0) + sass-listen (4.0.0) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + sass-rails (5.0.6) + railties (>= 4.0.0, < 6) + sass (~> 3.1) + sprockets (>= 2.8, < 4.0) + sprockets-rails (>= 2.0, < 4.0) + tilt (>= 1.1, < 3) + shoulda-context (1.2.1) + slop (3.6.0) + spring (1.7.2) + spring-commands-rspec (1.0.4) + spring (>= 0.9.1) + spring-watcher-listen (2.0.1) + listen (>= 2.7, < 4.0) + spring (>= 1.2, < 3.0) + sprockets (3.7.1) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.2.0) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + sqlite3 (1.3.11) + thor (0.19.4) + thread_safe (0.3.6) + tilt (2.0.8) + turbolinks (5.0.1) + turbolinks-source (~> 5) + turbolinks-source (5.0.3) + tzinfo (1.2.3) + thread_safe (~> 0.1) + websocket-driver (0.6.5) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.2) + yajl-ruby (1.2.2) + yard (0.9.5) + zeus (0.15.14) + method_source (>= 0.6.7) + +PLATFORMS + ruby + +DEPENDENCIES + activerecord-jdbc-adapter + activerecord-jdbcsqlite3-adapter + appraisal (= 2.1.0) + bcrypt (~> 3.1.7) + bundler (~> 1.1) + fssm + jbuilder (~> 2.5) + jdbc-sqlite3 + jquery-rails + jruby-openssl + listen (~> 3.0.5) + minitest-reporters + nokogiri (~> 1.8) + pg + pry + pry-byebug + puma (~> 3.0) + pygments.rb + rails (~> 5.0.4) + rails-controller-testing (>= 1.0.1) + rake (>= 10.5.0, < 11) + redcarpet + rspec (~> 3.6) + rspec-rails (~> 3.6) + sass-rails (~> 5.0) + shoulda-context (~> 1.2.0) + spring + spring-commands-rspec + spring-watcher-listen (~> 2.0.0) + sqlite3 + therubyrhino + turbolinks (~> 5) + yard + zeus + +BUNDLED WITH + 1.15.3 diff --git a/lib/shoulda/matchers/active_model/allow_value_matcher.rb b/lib/shoulda/matchers/active_model/allow_value_matcher.rb index 3b99ed1cf..97f797a94 100644 --- a/lib/shoulda/matchers/active_model/allow_value_matcher.rb +++ b/lib/shoulda/matchers/active_model/allow_value_matcher.rb @@ -332,6 +332,7 @@ def initialize(*values) @context = nil @values_to_preset = {} @failure_message_preface = nil + @attribute_changed_value_message = nil end def for(attribute_name) diff --git a/lib/shoulda/matchers/active_model/validate_inclusion_of_matcher.rb b/lib/shoulda/matchers/active_model/validate_inclusion_of_matcher.rb index fb38410d7..3116209d8 100644 --- a/lib/shoulda/matchers/active_model/validate_inclusion_of_matcher.rb +++ b/lib/shoulda/matchers/active_model/validate_inclusion_of_matcher.rb @@ -269,7 +269,7 @@ def validate_inclusion_of(attr) # @private class ValidateInclusionOfMatcher < ValidationMatcher ARBITRARY_OUTSIDE_STRING = 'shoulda-matchers test string' - ARBITRARY_OUTSIDE_FIXNUM = 123456789 + ARBITRARY_OUTSIDE_INTEGER = 123456789 ARBITRARY_OUTSIDE_DECIMAL = BigDecimal.new('0.123456789') ARBITRARY_OUTSIDE_DATE = Date.jd(9999999) ARBITRARY_OUTSIDE_DATETIME = DateTime.jd(9999999) @@ -483,8 +483,8 @@ def outside_values case attribute_type when :boolean boolean_outside_values - when :fixnum - [ARBITRARY_OUTSIDE_FIXNUM] + when :integer + [ARBITRARY_OUTSIDE_INTEGER] when :decimal [ARBITRARY_OUTSIDE_DECIMAL] when :date @@ -538,7 +538,7 @@ def attribute_column def column_type_to_attribute_type(type) case type - when :integer, :float then :fixnum + when :integer, :float then :integer when :timestamp then :datetime else type end @@ -548,7 +548,7 @@ def value_to_attribute_type(value) case value when true, false then :boolean when BigDecimal then :decimal - when Fixnum then :fixnum + when Integer then :integer when Date then :date when DateTime then :datetime when Time then :time diff --git a/lib/shoulda/matchers/active_record/association_matchers/join_table_matcher.rb b/lib/shoulda/matchers/active_record/association_matchers/join_table_matcher.rb index c46f2d4bf..b214445f7 100644 --- a/lib/shoulda/matchers/active_record/association_matchers/join_table_matcher.rb +++ b/lib/shoulda/matchers/active_record/association_matchers/join_table_matcher.rb @@ -38,7 +38,7 @@ def join_table_option_correct? end def join_table_exists? - if connection.tables.include?(join_table_name) + if RailsShim.tables_and_views(connection).include?(join_table_name) true else @failure_message = missing_table_message diff --git a/lib/shoulda/matchers/active_record/association_matchers/option_verifier.rb b/lib/shoulda/matchers/active_record/association_matchers/option_verifier.rb index 999feb7ad..3ad93b762 100644 --- a/lib/shoulda/matchers/active_record/association_matchers/option_verifier.rb +++ b/lib/shoulda/matchers/active_record/association_matchers/option_verifier.rb @@ -34,15 +34,16 @@ def correct_for_relation_clause?(name, expected_value) def correct_for?(*args) expected_value, name, type = args.reverse + if expected_value.nil? true else - expected_value = type_cast( + type_cast_expected_value = type_cast( type, expected_value_for(type, name, expected_value) ) actual_value = type_cast(type, actual_value_for(name)) - expected_value == actual_value + type_cast_expected_value == actual_value end end @@ -65,10 +66,14 @@ def actual_value_for(name) def type_cast(type, value) case type - when :string, :relation_clause then value.to_s - when :boolean then !!value - when :hash then Hash(value).stringify_keys - else value + when :string, :relation_clause + value.to_s + when :boolean + !!value + when :hash + Hash(value).stringify_keys + else + value end end diff --git a/lib/shoulda/matchers/doublespeak/object_double.rb b/lib/shoulda/matchers/doublespeak/object_double.rb index 823797b33..17b27af43 100644 --- a/lib/shoulda/matchers/doublespeak/object_double.rb +++ b/lib/shoulda/matchers/doublespeak/object_double.rb @@ -14,7 +14,11 @@ def calls_to(method_name) @calls_by_method_name[method_name] || [] end - def respond_to?(name, include_private = nil) + def respond_to?(_name, _include_private = nil) + true + end + + def respond_to_missing?(_name, _include_all) true end diff --git a/lib/shoulda/matchers/rails_shim.rb b/lib/shoulda/matchers/rails_shim.rb index 7eb10b688..471d9049c 100644 --- a/lib/shoulda/matchers/rails_shim.rb +++ b/lib/shoulda/matchers/rails_shim.rb @@ -23,9 +23,11 @@ def self.serialized_attributes_for(model) if defined?(::ActiveRecord::Type::Serialized) # Rails 5+ model.columns.select do |column| - column.cast_type.is_a?(::ActiveRecord::Type::Serialized) + model.type_for_attribute(column.name).is_a?( + ::ActiveRecord::Type::Serialized, + ) end.inject({}) do |hash, column| - hash[column.name.to_s] = column.cast_type.coder + hash[column.name.to_s] = model.type_for_attribute(column.name).coder hash end else @@ -55,6 +57,14 @@ def self.simply_generate_validation_message(attribute, type, model_name, options I18n.translate(primary_translation_key, translate_options) end + def self.tables_and_views(connection) + if active_record_major_version >= 5 + connection.data_sources + else + connection.tables + end + end + def self.active_record_major_version ::ActiveRecord::VERSION::MAJOR end diff --git a/shoulda-matchers.gemspec b/shoulda-matchers.gemspec index 31f1d1deb..77339a6fd 100644 --- a/shoulda-matchers.gemspec +++ b/shoulda-matchers.gemspec @@ -18,6 +18,6 @@ Gem::Specification.new do |s| s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } s.require_paths = ["lib"] - s.required_ruby_version = '>= 2.0.0' - s.add_dependency('activesupport', '>= 4.0.0') + s.required_ruby_version = '>= 2.2.0' + s.add_dependency('activesupport', '>= 4.2.0') end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 1c7a7535b..c29671351 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -7,15 +7,14 @@ require 'rspec' RSpec.configure do |config| - config.order = :random - config.expect_with :rspec do |c| c.syntax = :expect end + config.order = :random config.default_formatter = 'doc' - config.mock_with :rspec + config.example_status_persistence_file_path = 'spec/examples.txt' end $VERBOSE = true diff --git a/spec/support/unit/attribute.rb b/spec/support/unit/attribute.rb index c2cb82dcf..3540e68bd 100644 --- a/spec/support/unit/attribute.rb +++ b/spec/support/unit/attribute.rb @@ -1,7 +1,5 @@ module UnitTests class Attribute - attr_reader :name, :column_type, :column_options - DEFAULT_COLUMN_TYPE = :string DEFAULT_COLUMN_OPTIONS = { null: false, diff --git a/spec/support/unit/capture.rb b/spec/support/unit/capture.rb index ddacfbd82..a5879954f 100644 --- a/spec/support/unit/capture.rb +++ b/spec/support/unit/capture.rb @@ -2,7 +2,9 @@ module Kernel # #capture, #silence_stream, and #silence_stderr are deprecated after Rails # 4.2 and will be removed in 5.0, so just override them completely here - undef_method :capture + if method_defined?(:capture) + undef_method :capture + end def capture(stream) stream = stream.to_s @@ -20,7 +22,9 @@ def capture(stream) stream_io.reopen(origin_stream) end - undef_method :silence_stream + if method_defined?(:silence_stream) + undef_method :silence_stream + end def silence_stream(stream) old_stream = stream.dup @@ -32,7 +36,9 @@ def silence_stream(stream) old_stream.close end - undef_method :silence_stderr + if method_defined?(:silence_stderr) + undef_method :silence_stderr + end def silence_stderr silence_stream(STDERR) { yield } diff --git a/spec/support/unit/helpers/active_record_versions.rb b/spec/support/unit/helpers/active_record_versions.rb index 94e21f2ee..d682b235a 100644 --- a/spec/support/unit/helpers/active_record_versions.rb +++ b/spec/support/unit/helpers/active_record_versions.rb @@ -20,5 +20,13 @@ def active_record_supports_has_secure_password? def active_record_supports_array_columns? active_record_version > 4.2 end + + def active_record_supports_relations? + active_record_version >= 4 + end + + def active_record_supports_more_dependent_options? + active_record_version >= 4 + end end end diff --git a/spec/support/unit/helpers/active_resource_builder.rb b/spec/support/unit/helpers/active_resource_builder.rb index b3b490d39..ea60d70b9 100644 --- a/spec/support/unit/helpers/active_resource_builder.rb +++ b/spec/support/unit/helpers/active_resource_builder.rb @@ -1,8 +1,8 @@ -require 'active_resource' - module UnitTests module ActiveResourceBuilder def self.configure_example_group(example_group) + require 'active_resource' + example_group.include ActiveResourceBuilder example_group.after do diff --git a/spec/support/unit/helpers/controller_builder.rb b/spec/support/unit/helpers/controller_builder.rb index 591de0200..e5e651a89 100644 --- a/spec/support/unit/helpers/controller_builder.rb +++ b/spec/support/unit/helpers/controller_builder.rb @@ -22,7 +22,7 @@ def define_routes(&block) def build_fake_response(opts = {}, &block) action = opts[:action] || 'example' partial = opts[:partial] || '_partial' - block ||= lambda { render nothing: true } + block ||= lambda { head :ok } controller_class = define_controller('Examples') do layout false define_method(action, &block) diff --git a/spec/support/unit/helpers/rails_versions.rb b/spec/support/unit/helpers/rails_versions.rb index 7df93f651..161f96283 100644 --- a/spec/support/unit/helpers/rails_versions.rb +++ b/spec/support/unit/helpers/rails_versions.rb @@ -1,5 +1,7 @@ module UnitTests module RailsVersions + extend self + def self.configure_example_group(example_group) example_group.include(self) example_group.extend(self) @@ -17,6 +19,10 @@ def rails_4_x? rails_version =~ '~> 4.0' end + def rails_lte_4? + rails_version <= 4 + end + def rails_gte_4_1? rails_version >= 4.1 end @@ -24,5 +30,9 @@ def rails_gte_4_1? def rails_gte_4_2? rails_version >= 4.2 end + + def rails_lte_5? + rails_version < 5 + end end end diff --git a/spec/support/unit/model_creation_strategies/active_record.rb b/spec/support/unit/model_creation_strategies/active_record.rb index f9e268b47..ed8a83a64 100644 --- a/spec/support/unit/model_creation_strategies/active_record.rb +++ b/spec/support/unit/model_creation_strategies/active_record.rb @@ -42,7 +42,7 @@ def define_class_for_model run_block(model, block) end - if whitelist_attributes? + if whitelist_attributes? && model.respond_to?(:attr_accessible) model.attr_accessible(*columns.keys) end diff --git a/spec/support/unit/model_creators/active_record.rb b/spec/support/unit/model_creators/active_record.rb index 82afd5f74..23898a196 100644 --- a/spec/support/unit/model_creators/active_record.rb +++ b/spec/support/unit/model_creators/active_record.rb @@ -14,7 +14,6 @@ def self.call(args) :arguments, :attribute_default_values_by_name, :attribute_name, - :customize_model, :model_name, ) diff --git a/spec/support/unit/model_creators/basic.rb b/spec/support/unit/model_creators/basic.rb index c2fded58f..3791fd83f 100644 --- a/spec/support/unit/model_creators/basic.rb +++ b/spec/support/unit/model_creators/basic.rb @@ -80,7 +80,7 @@ def possibly_override_attribute_writer_method_for(model) ) if respond_to?(:write_attribute) - write_attribute(new_value) + write_attribute(attribute_name, new_value) else super(new_value) end diff --git a/spec/support/unit/rails_application.rb b/spec/support/unit/rails_application.rb index 3dc07aa91..3ffdbc29a 100644 --- a/spec/support/unit/rails_application.rb +++ b/spec/support/unit/rails_application.rb @@ -2,6 +2,7 @@ require_relative '../tests/command_runner' require_relative '../tests/database' require_relative '../tests/filesystem' +require_relative 'helpers/rails_versions' require 'yaml' @@ -75,6 +76,10 @@ def generate rails_new fix_available_locales_warning write_database_configuration + + if bundle.version_of("rails") >= 5 + add_initializer_for_time_zone_aware_types + end end def rails_new @@ -97,6 +102,15 @@ def write_database_configuration YAML.dump(database.config.to_hash, fs.open('config/database.yml', 'w')) end + def add_initializer_for_time_zone_aware_types + path = 'config/initializers/configure_time_zone_aware_types.rb' + fs.write(path, <<-TEXT) +Rails.application.configure do + config.active_record.time_zone_aware_types = [:datetime, :time] +end + TEXT + end + def load_environment require environment_file_path end diff --git a/spec/support/unit/validation_matcher_scenario.rb b/spec/support/unit/validation_matcher_scenario.rb index 4bab77e6f..0a3567565 100644 --- a/spec/support/unit/validation_matcher_scenario.rb +++ b/spec/support/unit/validation_matcher_scenario.rb @@ -4,8 +4,6 @@ module UnitTests class ValidationMatcherScenario extend Forwardable - attr_reader :matcher - def initialize(arguments) @arguments = arguments.dup @matcher_proc = @arguments.delete(:matcher_proc) diff --git a/spec/unit/shoulda/matchers/action_controller/render_template_matcher_spec.rb b/spec/unit/shoulda/matchers/action_controller/render_template_matcher_spec.rb index 0533b4694..1ad1cde79 100644 --- a/spec/unit/shoulda/matchers/action_controller/render_template_matcher_spec.rb +++ b/spec/unit/shoulda/matchers/action_controller/render_template_matcher_spec.rb @@ -69,7 +69,7 @@ def controller_with_customer_partial context 'a controller that does not render a template' do it 'rejects rendering a template' do - expect(build_fake_response { render nothing: true }). + expect(build_fake_response { head :ok }). not_to render_template(:show) end end diff --git a/spec/unit/shoulda/matchers/active_model/allow_mass_assignment_of_matcher_spec.rb b/spec/unit/shoulda/matchers/active_model/allow_mass_assignment_of_matcher_spec.rb index 175aec926..f53c82e62 100644 --- a/spec/unit/shoulda/matchers/active_model/allow_mass_assignment_of_matcher_spec.rb +++ b/spec/unit/shoulda/matchers/active_model/allow_mass_assignment_of_matcher_spec.rb @@ -1,115 +1,117 @@ require 'unit_spec_helper' describe Shoulda::Matchers::ActiveModel::AllowMassAssignmentOfMatcher, type: :model do - context '#description' do - context 'without a role' do - it 'includes the attribute name' do - expect(described_class.new(:attr).description). - to eq 'allow mass assignment of attr' + if rails_lte_5? + context '#description' do + context 'without a role' do + it 'includes the attribute name' do + expect(described_class.new(:attr).description). + to eq 'allow mass assignment of attr' + end end - end - if active_model_3_1? - context 'with a role' do - it 'includes the attribute name and the role' do - expect(described_class.new(:attr).as(:admin).description). - to eq 'allow mass assignment of attr as admin' + if active_model_3_1? + context 'with a role' do + it 'includes the attribute name and the role' do + expect(described_class.new(:attr).as(:admin).description). + to eq 'allow mass assignment of attr as admin' + end end end end - end - context 'an attribute that is blacklisted from mass-assignment' do - it 'rejects being mass-assignable' do - model = define_model(:example, blacklisted: :string) do - attr_protected :blacklisted - end.new + context 'an attribute that is blacklisted from mass-assignment' do + it 'rejects being mass-assignable' do + model = define_model(:example, blacklisted: :string) do + attr_protected :blacklisted + end.new - expect(model).not_to allow_mass_assignment_of(:blacklisted) + expect(model).not_to allow_mass_assignment_of(:blacklisted) + end end - end - context 'an attribute that is not whitelisted for mass-assignment' do - it 'rejects being mass-assignable' do - model = define_model(:example, not_whitelisted: :string, - whitelisted: :string) do - attr_accessible :whitelisted - end.new + context 'an attribute that is not whitelisted for mass-assignment' do + it 'rejects being mass-assignable' do + model = define_model(:example, not_whitelisted: :string, + whitelisted: :string) do + attr_accessible :whitelisted + end.new - expect(model).not_to allow_mass_assignment_of(:not_whitelisted) + expect(model).not_to allow_mass_assignment_of(:not_whitelisted) + end end - end - context 'an attribute that is whitelisted for mass-assignment' do - it 'accepts being mass-assignable' do - expect(define_model(:example, whitelisted: :string) do - attr_accessible :whitelisted - end.new).to allow_mass_assignment_of(:whitelisted) + context 'an attribute that is whitelisted for mass-assignment' do + it 'accepts being mass-assignable' do + expect(define_model(:example, whitelisted: :string) do + attr_accessible :whitelisted + end.new).to allow_mass_assignment_of(:whitelisted) + end end - end - context 'an attribute not included in the mass-assignment blacklist' do - it 'accepts being mass-assignable' do - model = define_model(:example, not_blacklisted: :string, - blacklisted: :string) do - attr_protected :blacklisted - end.new + context 'an attribute not included in the mass-assignment blacklist' do + it 'accepts being mass-assignable' do + model = define_model(:example, not_blacklisted: :string, + blacklisted: :string) do + attr_protected :blacklisted + end.new - expect(model).to allow_mass_assignment_of(:not_blacklisted) + expect(model).to allow_mass_assignment_of(:not_blacklisted) + end end - end - unless active_model_3_2? || active_model_4_0? - context 'an attribute on a class with no protected attributes' do - it 'accepts being mass-assignable' do - expect(no_protected_attributes).to allow_mass_assignment_of(:attr) - end + unless active_model_3_2? || active_model_4_0? + context 'an attribute on a class with no protected attributes' do + it 'accepts being mass-assignable' do + expect(no_protected_attributes).to allow_mass_assignment_of(:attr) + end - it 'assigns a negative failure message' do - matcher = allow_mass_assignment_of(:attr) + it 'assigns a negative failure message' do + matcher = allow_mass_assignment_of(:attr) - expect(matcher.matches?(no_protected_attributes)).to eq true + expect(matcher.matches?(no_protected_attributes)).to eq true - expect(matcher.failure_message_when_negated).not_to be_nil + expect(matcher.failure_message_when_negated).not_to be_nil + end end - end - - def no_protected_attributes - define_model(:example, attr: :string).new - end - end - context 'an attribute on a class with all protected attributes' do - it 'rejects being mass-assignable' do - expect(all_protected_attributes).not_to allow_mass_assignment_of(:attr) - end - - def all_protected_attributes - define_model(:example, attr: :string) do - attr_accessible nil - end.new + def no_protected_attributes + define_model(:example, attr: :string).new + end end - end - if active_model_3_1? - context 'an attribute included in the mass-assignment whitelist for admin role only' do + context 'an attribute on a class with all protected attributes' do it 'rejects being mass-assignable' do - expect(mass_assignable_as_admin).not_to allow_mass_assignment_of(:attr) - end - - it 'accepts being mass-assignable for admin' do - expect(mass_assignable_as_admin).to allow_mass_assignment_of(:attr).as(:admin) + expect(all_protected_attributes).not_to allow_mass_assignment_of(:attr) end - def mass_assignable_as_admin + def all_protected_attributes define_model(:example, attr: :string) do - attr_accessible :attr, as: :admin + attr_accessible nil end.new end end - end - def define_model(name, columns, &block) - super(name, columns, whitelist_attributes: false, &block) + if active_model_3_1? + context 'an attribute included in the mass-assignment whitelist for admin role only' do + it 'rejects being mass-assignable' do + expect(mass_assignable_as_admin).not_to allow_mass_assignment_of(:attr) + end + + it 'accepts being mass-assignable for admin' do + expect(mass_assignable_as_admin).to allow_mass_assignment_of(:attr).as(:admin) + end + + def mass_assignable_as_admin + define_model(:example, attr: :string) do + attr_accessible :attr, as: :admin + end.new + end + end + end + + def define_model(name, columns, &block) + super(name, columns, whitelist_attributes: false, &block) + end end end diff --git a/spec/unit/shoulda/matchers/active_model/validate_inclusion_of_matcher_spec.rb b/spec/unit/shoulda/matchers/active_model/validate_inclusion_of_matcher_spec.rb index d944c466a..62a322d4d 100644 --- a/spec/unit/shoulda/matchers/active_model/validate_inclusion_of_matcher_spec.rb +++ b/spec/unit/shoulda/matchers/active_model/validate_inclusion_of_matcher_spec.rb @@ -192,20 +192,19 @@ def validation_matcher_scenario_args end context 'against a time attribute' do - now = Time.now + default_time = Time.zone.local(2000, 1, 1) - define_method(:now) { now } + define_method(:default_time) { default_time } it_behaves_like 'it supports in_array', - possible_values: (1..5).map { |n| now + n }, - reserved_outside_value: described_class::ARBITRARY_OUTSIDE_TIME + possible_values: (1..3).map { |hour| default_time.change(hour: hour) } it_behaves_like 'it supports in_range', - possible_values: (now .. now + 5) + possible_values: (default_time.change(hour: 1) .. default_time.change(hour: 3)) define_method :build_object do |options = {}, &block| build_object_with_generic_attribute( - options.merge(column_type: :time, value: now), + options.merge(column_type: :time, value: default_time), &block ) end @@ -215,7 +214,7 @@ def add_outside_value_to(values) end def validation_matcher_scenario_args - super.deep_merge(column_type: :time, default_value: now) + super.deep_merge(column_type: :time, default_value: default_time) end end @@ -434,7 +433,7 @@ def configure_validation_matcher(matcher) shared_examples_for 'it supports in_array' do |args| possible_values = args.fetch(:possible_values) zero = args[:zero] - reserved_outside_value = args.fetch(:reserved_outside_value) + reserved_outside_value = args[:reserved_outside_value] define_method(:valid_values) { args.fetch(:possible_values) } @@ -466,12 +465,14 @@ def configure_validation_matcher(matcher) expect_not_to_match_on_values(builder, add_outside_value_to(possible_values)) end - it 'raises an error when valid and given value is our test outside value' do - error_class = Shoulda::Matchers::ActiveModel::CouldNotDetermineValueOutsideOfArray - builder = build_object_allowing([reserved_outside_value]) + if reserved_outside_value + it 'raises an error when valid and given value is our test outside value' do + error_class = Shoulda::Matchers::ActiveModel::CouldNotDetermineValueOutsideOfArray + builder = build_object_allowing([reserved_outside_value]) - expect { expect_to_match_on_values(builder, [reserved_outside_value]) }. - to raise_error(error_class) + expect { expect_to_match_on_values(builder, [reserved_outside_value]) }. + to raise_error(error_class) + end end it_behaves_like 'it supports allow_nil', valid_values: possible_values diff --git a/spec/unit/shoulda/matchers/active_model/validate_presence_of_matcher_spec.rb b/spec/unit/shoulda/matchers/active_model/validate_presence_of_matcher_spec.rb index 9495bdf10..7aed8f633 100644 --- a/spec/unit/shoulda/matchers/active_model/validate_presence_of_matcher_spec.rb +++ b/spec/unit/shoulda/matchers/active_model/validate_presence_of_matcher_spec.rb @@ -291,12 +291,14 @@ def model_creator end end - context 'an active_resource model' do - context 'with the validation context' do - it 'does not raise an exception' do - expect { - expect(active_resource_model).to validate_presence_of(:attr) - }.to_not raise_exception + if rails_lte_4? + context 'an active_resource model' do + context 'with the validation context' do + it 'does not raise an exception' do + expect do + expect(active_resource_model).to validate_presence_of(:attr) + end.to_not raise_exception + end end end end diff --git a/spec/unit/shoulda/matchers/active_record/association_matcher_spec.rb b/spec/unit/shoulda/matchers/active_record/association_matcher_spec.rb index b51f9b4e9..f383487a9 100644 --- a/spec/unit/shoulda/matchers/active_record/association_matcher_spec.rb +++ b/spec/unit/shoulda/matchers/active_record/association_matcher_spec.rb @@ -1210,7 +1210,7 @@ def having_and_belonging_to_many_non_existent_class(model_name, assoc_name, opti def define_association_with_conditions(model, macro, name, conditions, other_options={}) args = [] options = {} - if Shoulda::Matchers::RailsShim.active_record_major_version == 4 + if active_record_supports_relations? args << proc { where(conditions) } else options[:conditions] = conditions @@ -1222,7 +1222,7 @@ def define_association_with_conditions(model, macro, name, conditions, other_opt def define_association_with_order(model, macro, name, order, other_options={}) args = [] options = {} - if Shoulda::Matchers::RailsShim.active_record_major_version == 4 + if active_record_supports_relations? args << proc { order(order) } else options[:order] = order @@ -1232,11 +1232,10 @@ def define_association_with_order(model, macro, name, order, other_options={}) end def dependent_options - case Rails.version - when /\A3/ - [:destroy, :delete, :nullify, :restrict] - when /\A4/ + if active_record_supports_more_dependent_options? [:destroy, :delete, :nullify, :restrict_with_exception, :restrict_with_error] + else + [:destroy, :delete, :nullify, :restrict] end end end diff --git a/spec/unit/shoulda/matchers/active_record/validate_uniqueness_of_matcher_spec.rb b/spec/unit/shoulda/matchers/active_record/validate_uniqueness_of_matcher_spec.rb index 114537bcf..b8a72af6b 100644 --- a/spec/unit/shoulda/matchers/active_record/validate_uniqueness_of_matcher_spec.rb +++ b/spec/unit/shoulda/matchers/active_record/validate_uniqueness_of_matcher_spec.rb @@ -1266,7 +1266,10 @@ def configure_validation_matcher(matcher) favoriteable_type: { type: :string, options: { null: false } } } favorite_model = define_model 'Favorite', favorite_columns do - attr_accessible :favoriteable + if respond_to?(:attr_accessible) + attr_accessible :favoriteable + end + belongs_to :favoriteable, polymorphic: true validates :favoriteable, presence: true validates :favoriteable_id, uniqueness: { scope: :favoriteable_type } @@ -1291,7 +1294,10 @@ def configure_validation_matcher(matcher) favoriteable_type: { type: :string, options: { null: false } } } favorite_model = define_model 'Models::Favorite', favorite_columns do - attr_accessible :favoriteable + if respond_to?(:attr_accessible) + attr_accessible :favoriteable + end + belongs_to :favoriteable, polymorphic: true validates :favoriteable, presence: true validates :favoriteable_id, uniqueness: { scope: :favoriteable_type } @@ -1547,8 +1553,10 @@ def define_model_validating_uniqueness(options = {}, &block) m.validates_uniqueness_of attribute_name, validation_options.merge(scope: scope_attribute_names) - attributes.each do |attr| - m.attr_accessible(attr[:name]) + if m.respond_to?(:attr_accessible) + attributes.each do |attr| + m.attr_accessible(attr[:name]) + end end block.call(m) if block @@ -1591,7 +1599,9 @@ def build_record_validating_scoped_uniqueness_with_enum(options = {}) def define_model_without_validation define_model(:example, attribute_name => :string) do |model| - model.attr_accessible(attribute_name) + if model.respond_to?(:attr_accessible) + model.attr_accessible(attribute_name) + end end end diff --git a/spec/unit/shoulda/matchers/doublespeak/world_spec.rb b/spec/unit/shoulda/matchers/doublespeak/world_spec.rb index af3858769..9b0ae96ab 100644 --- a/spec/unit/shoulda/matchers/doublespeak/world_spec.rb +++ b/spec/unit/shoulda/matchers/doublespeak/world_spec.rb @@ -33,10 +33,8 @@ module Shoulda::Matchers::Doublespeak block_called = false double_collections = Array.new(3) { build_double_collection } double_collections.each do |double_collection| - allow(double_collection).to receive(:activate).ordered - end - double_collections.each do |double_collection| - allow(double_collection).to receive(:deactivate).ordered + allow(double_collection).to receive(:activate) + allow(double_collection).to receive(:deactivate) end klasses = Array.new(3) { |i| "Klass #{i}" } world = described_class.new diff --git a/spec/unit_spec_helper.rb b/spec/unit_spec_helper.rb index 63f61b46a..ba99e6b05 100644 --- a/spec/unit_spec_helper.rb +++ b/spec/unit_spec_helper.rb @@ -12,7 +12,6 @@ RSpec.configure do |config| UnitTests::ActiveModelHelpers.configure_example_group(config) UnitTests::ActiveModelVersions.configure_example_group(config) - UnitTests::ActiveResourceBuilder.configure_example_group(config) UnitTests::ClassBuilder.configure_example_group(config) UnitTests::ControllerBuilder.configure_example_group(config) UnitTests::I18nFaker.configure_example_group(config) @@ -25,6 +24,10 @@ UnitTests::ColumnTypeHelpers.configure_example_group(config) UnitTests::ValidationMatcherScenarioHelpers.configure_example_group(config) + if UnitTests::RailsVersions.rails_lte_4? + UnitTests::ActiveResourceBuilder.configure_example_group(config) + end + config.include UnitTests::Matchers config.infer_spec_type_from_file_location!