Prior to this commit the tests generated a full rails app, but didn't need many of the libraries included by default. Unneeded gems make the test suite slower, and increase the chance of getting errors when new versions of each gem come out.
This commit gets the Travis build passing by:
- Removing Rails 4.2 so we don't have to deal with bundler < 2 anymore
- Bumping to latest Rails versions
- Explicitly listing all gems that appear in the default Rails Gemfile
- Avoiding bootsnap and javascript, since they aren't relevant to these tests
Co-authored-by: alex <alexandr1golubenko@gmail.com>
* Write a failing test for reloading with Spring
This test captures what I think is going on in
https://github.com/thoughtbot/factory_bot_rails/issues/323
Currently the factory_bot_rails reloader only reloads factory
definitions when the definition files have changes (using
`execute_if_updated`).
This can cause problems when editing an application file without also
editing a factory_bot definition file. Rails will reload the entire
application, but will not reload the definitions. This causes
factory_bot to have references to classes that were unloaded from the
Rails application and replaced with new classes.
https://github.com/thoughtbot/factory_bot_rails/pull/329 replaces
`execute_if_updated` with `execute` so that factory_bot_rails will
reload the definition files whenever anything in the application is
changed. Hopefully that PR will get this test to pass!
This partially addresses #293. Since rubocop generated quite a few todos, the commits addressing them are split up into a few different PRs that cover different files.
* Remove gemfiles from version control to match same testing style as
Clearance and Suspenders.
* MiniTest does not need to be manually included as it is automatically
included by Rails by default.
* Add spring for Rails 4.1.
* Disable Spring to get specs to pass on Rails 4.1.
* Add therubyrhino for JRuby.
* Remove old references to Rails 3.
* Fix JRuby test where output is "1 runs", not "1 tests".
* Remove Rails 3.0 reference to "turn".
JRuby does not support setting/unsetting environment variables.
Thus, we will launch an entirely new process without the parents env when
we run `bundle install` inside the generated rails apps, forcing them to
use their own Gemfile, instead of the BUNDLE_GEMFILE setting from the main
gem codebase.
Previously, the railties required by the project gemspec was in conflict with
the rails versions being pulled in by Appraisal.
There were situations where a newer rails app was generated by `rails new...`
even though the Appraisal gemfiles/ value should have been setting it correctly.
We need to be able to use the versions of things specified in the appraisal gemfiles/
specify the version of rails for the initial generation of the applications,
but subsequently allow those applications to point to the `Gemfile` within
the newly generated rails apps, rather than wherever BUNDLE_GEMFILE was previously
set by Appraisal.