-
-
Notifications
You must be signed in to change notification settings - Fork 910
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing test dependences to Appraisals
Since as of commit 2748b75, we no longer install dependencies inside of the Rails app that is generated and used to run all of the tests, we have to require all of the dependencies that the app would install inside of the appropriate Appraisals. This was mostly straightforward except for some workarounds with the turn gem: * Rails 3.1 requires two versions of turn depending on which Ruby version you're using. On 1.9.2, it uses turn 0.9.2; after 1.9.2, it uses ~> 0.9.3. To accommodate this we have to have two versions of the Rails 3.1 appraisal which declare the different turn versions. * Rails 3.1 also loads the turn gem even if, in the Gemfile for the app, turn is declared with `require: false`. This causes a problem while running our tests because turn actually requires minitest/autorun, which adds a hook so when Ruby exits, Minitest tests are run. Because we're already using RSpec, Minitest will try to re-run the `rspec` command we ran within a Minitest environment. This will fail since we are using RSpec-specific command line options to run the tests. Unfortunately there's no way to shut off minitest/autorun after it's been required, so we have to monkey-patch Minitest's #run method so it's a no-op.
- Loading branch information
Showing
16 changed files
with
442 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,85 @@ | ||
rails_4_0 = proc do | ||
ruby_version = Gem::Version.new(RUBY_VERSION + '') | ||
|
||
rails_3 = proc do | ||
gem 'strong_parameters' | ||
end | ||
|
||
rails_3_1 = proc do | ||
instance_eval(&rails_3) | ||
gem 'rails', '~> 3.1.8' | ||
gem 'bcrypt-ruby', '~> 3.0.0' | ||
gem 'jquery-rails' | ||
gem 'sass-rails', '~> 3.1.5' | ||
gem 'coffee-rails', '~> 3.1.1' | ||
gem 'uglifier', '>= 1.0.3' | ||
end | ||
|
||
rails_4 = proc do | ||
gem 'uglifier', '>= 1.3.0' | ||
gem 'coffee-rails', '~> 4.0.0' | ||
gem 'jquery-rails' | ||
gem 'turbolinks' | ||
gem 'jbuilder', '~> 1.2' | ||
gem 'sdoc' | ||
gem 'activeresource', '4.0.0' | ||
# Test suite makes heavy use of attr_accessible | ||
gem 'protected_attributes' | ||
end | ||
|
||
#--- | ||
|
||
if RUBY_VERSION < '2.0' | ||
if Gem::Requirement.new('< 2').satisfied_by?(ruby_version) | ||
appraise '3.0' do | ||
instance_eval(&rails_3) | ||
gem 'rails', '~> 3.0.17' | ||
gem 'strong_parameters' | ||
end | ||
|
||
appraise '3.1' do | ||
gem 'rails', '~> 3.1.8' | ||
gem 'bcrypt-ruby', '~> 3.0.0' | ||
gem 'jquery-rails' | ||
gem 'sass-rails' | ||
gem 'strong_parameters' | ||
if Gem::Requirement.new('= 1.9.2').satisfied_by?(ruby_version) | ||
appraise '3.1-1.9.2' do | ||
instance_eval(&rails_3_1) | ||
gem 'turn', '0.8.2' | ||
end | ||
else | ||
appraise '3.1' do | ||
instance_eval(&rails_3_1) | ||
gem 'turn', '~> 0.8.3' | ||
end | ||
end | ||
end | ||
|
||
appraise '3.2' do | ||
instance_eval(&rails_3) | ||
gem 'rails', '~> 3.2.13' | ||
gem 'bcrypt-ruby', '~> 3.0.0' | ||
gem 'jquery-rails' | ||
gem 'sass-rails' | ||
gem 'strong_parameters' | ||
gem 'sass-rails', '~> 3.2.3' | ||
gem 'coffee-rails', '~> 3.2.1' | ||
gem 'uglifier', '>= 1.0.3' | ||
end | ||
|
||
appraise '4.0.0' do | ||
instance_eval(&rails_4_0) | ||
gem 'rails', '4.0.0' | ||
gem 'sass-rails', '4.0.0' | ||
gem 'bcrypt-ruby', '~> 3.0.0' | ||
end | ||
if Gem::Requirement.new('> 1.9.2').satisfied_by?(ruby_version) | ||
appraise '4.0.0' do | ||
instance_eval(&rails_4) | ||
gem 'rails', '4.0.0' | ||
gem 'sass-rails', '~> 4.0.0' | ||
gem 'bcrypt-ruby', '~> 3.0.0' | ||
end | ||
|
||
appraise '4.0.1' do | ||
instance_eval(&rails_4_0) | ||
gem 'rails', '4.0.1' | ||
gem 'sass-rails', '4.0.1' | ||
gem 'bcrypt-ruby', '~> 3.1.2' | ||
end | ||
appraise '4.0.1' do | ||
instance_eval(&rails_4) | ||
gem 'rails', '4.0.1' | ||
gem 'sass-rails', '~> 4.0.0' | ||
gem 'bcrypt-ruby', '~> 3.1.2' | ||
end | ||
|
||
appraise '4.1' do | ||
instance_eval(&rails_4_0) | ||
gem 'rails', '~> 4.1.0' | ||
gem 'sass-rails', '4.0.3' | ||
gem 'bcrypt-ruby', '~> 3.1.2' | ||
gem "protected_attributes", '~> 1.0.6' | ||
appraise '4.1' do | ||
instance_eval(&rails_4) | ||
gem 'rails', '~> 4.1.0' | ||
gem 'jbuilder', '~> 2.0' | ||
gem 'sass-rails', '~> 4.0.3' | ||
gem 'sdoc', '~> 0.4.0' | ||
gem 'bcrypt', '~> 3.1.7' | ||
gem 'protected_attributes', "~> 1.0.6" | ||
gem 'spring' | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# This file was generated by Appraisal | ||
|
||
source "https://rubygems.org" | ||
|
||
gem "shoulda-context", "~> 1.2.0" | ||
gem "sqlite3", :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 "strong_parameters" | ||
gem "rails", "~> 3.1.8" | ||
gem "bcrypt-ruby", "~> 3.0.0" | ||
gem "jquery-rails" | ||
gem "sass-rails", "~> 3.1.5" | ||
gem "coffee-rails", "~> 3.1.1" | ||
gem "uglifier", ">= 1.0.3" | ||
gem "turn", "0.8.2" | ||
|
||
gemspec :path=>".././" |
Oops, something went wrong.