2015-02-05 20:01:20 -05:00
|
|
|
shared_dependencies = proc do
|
2017-07-24 22:15:24 -04:00
|
|
|
gem 'rspec-rails', '~> 3.6'
|
2015-02-05 20:01:20 -05:00
|
|
|
gem 'shoulda-context', '~> 1.2.0'
|
|
|
|
gem 'sqlite3', platform: :ruby
|
2015-02-08 16:38:55 -05:00
|
|
|
gem 'pg', platform: :ruby
|
2015-02-05 20:01:20 -05:00
|
|
|
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
|
|
|
|
end
|
|
|
|
|
Use same assertion class as Rails, if loaded
Given this scenario:
* Using Rails 4.1
* Gemfile has `gem 'shoulda-matchers', require: false`
* spec_helper has `require 'shoulda/matchers'` following
`require 'rspec/rails'`
* Using Spring to run tests
matchers that delegate to assertions in Rails (e.g. `render_template`
and `route`) will fail in the wrong way if used. They fail because in
order to use these assertions, we expect that the assertions will
raise a specific exception, an exception that corresponds to whichever
test framework that Rails is using. For Rails versions that used
Test::Unit, this is Test::Unit::AssertionFailedError. For current Rails
versions, which now use Minitest, this exception is Minitest::Assertion.
The problem is that instead of asking Rails which exception class it's
using, we are trying to detect this exception class ourselves (for
cases in which Rails is not being used). This leads to the wrong class
being detected: when using a Rails version that uses Minitest, we choose
Test::Unit::AssertionFailedError as the class. This happens using the
exact scenario above because even though shoulda-matchers is loaded
after rspec-rails, rspec-rails itself defines
Test::Unit::AssertionFailedError.
Also add Cucumber tests that confirms this exact scenario works.
2014-06-21 23:24:22 -04:00
|
|
|
spring = proc do
|
|
|
|
gem 'spring'
|
|
|
|
gem 'spring-commands-rspec'
|
|
|
|
end
|
|
|
|
|
2017-07-05 13:27:48 -04:00
|
|
|
appraise '4.2' do
|
2015-02-05 20:01:20 -05:00
|
|
|
instance_eval(&shared_dependencies)
|
Use same assertion class as Rails, if loaded
Given this scenario:
* Using Rails 4.1
* Gemfile has `gem 'shoulda-matchers', require: false`
* spec_helper has `require 'shoulda/matchers'` following
`require 'rspec/rails'`
* Using Spring to run tests
matchers that delegate to assertions in Rails (e.g. `render_template`
and `route`) will fail in the wrong way if used. They fail because in
order to use these assertions, we expect that the assertions will
raise a specific exception, an exception that corresponds to whichever
test framework that Rails is using. For Rails versions that used
Test::Unit, this is Test::Unit::AssertionFailedError. For current Rails
versions, which now use Minitest, this exception is Minitest::Assertion.
The problem is that instead of asking Rails which exception class it's
using, we are trying to detect this exception class ourselves (for
cases in which Rails is not being used). This leads to the wrong class
being detected: when using a Rails version that uses Minitest, we choose
Test::Unit::AssertionFailedError as the class. This happens using the
exact scenario above because even though shoulda-matchers is loaded
after rspec-rails, rspec-rails itself defines
Test::Unit::AssertionFailedError.
Also add Cucumber tests that confirms this exact scenario works.
2014-06-21 23:24:22 -04:00
|
|
|
instance_eval(&spring)
|
Add missing test dependences to Appraisals
Since as of commit 2748b750873faf587c78d7a71f6c725b0fd4252a, 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.
2014-05-16 11:57:19 -04:00
|
|
|
gem 'uglifier', '>= 1.3.0'
|
|
|
|
gem 'jquery-rails'
|
2017-07-24 22:15:24 -04:00
|
|
|
gem 'turbolinks', '2.5.3'
|
Add missing test dependences to Appraisals
Since as of commit 2748b750873faf587c78d7a71f6c725b0fd4252a, 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.
2014-05-16 11:57:19 -04:00
|
|
|
gem 'sdoc'
|
2017-07-05 11:00:56 -04:00
|
|
|
gem 'json', '~> 1.4'
|
2013-12-01 17:57:03 -05:00
|
|
|
gem 'activeresource', '4.0.0'
|
|
|
|
gem 'protected_attributes'
|
2014-09-12 18:39:00 -04:00
|
|
|
gem 'minitest-reporters'
|
2017-07-05 10:07:34 -04:00
|
|
|
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'
|
|
|
|
gem 'protected_attributes', "~> 1.0.6"
|
|
|
|
end
|
|
|
|
|
2016-09-03 23:31:40 -04:00
|
|
|
appraise '5.0' do
|
2017-07-05 13:27:48 -04:00
|
|
|
instance_eval(&shared_dependencies)
|
|
|
|
instance_eval(&spring)
|
2017-07-05 10:07:34 -04:00
|
|
|
gem 'rails', '~> 5.0.4'
|
|
|
|
gem 'rails-controller-testing', '>= 1.0.1'
|
2017-07-25 02:13:17 -04:00
|
|
|
gem 'puma', '~> 3.0'
|
|
|
|
gem 'sass-rails', '~> 5.0'
|
|
|
|
gem 'jquery-rails'
|
|
|
|
gem 'turbolinks', '~> 5'
|
2017-07-05 10:07:34 -04:00
|
|
|
gem 'jbuilder', '~> 2.5'
|
|
|
|
gem 'bcrypt', '~> 3.1.7'
|
|
|
|
gem 'listen', '~> 3.0.5'
|
2017-07-25 02:13:17 -04:00
|
|
|
gem 'spring-watcher-listen', '~> 2.0.0'
|
2017-07-05 10:07:34 -04:00
|
|
|
gem 'nokogiri', '~> 1.8'
|
2017-07-25 01:17:56 -04:00
|
|
|
gem 'minitest-reporters'
|
2016-09-03 23:31:40 -04:00
|
|
|
end
|