However, a number of questions arise, for example, how does the test go without loading Rails and the code associated with the application?
The test loads the necessary code on demand when it tries to use it. So, for example, on some line of code, the test wants to use the Active::Record class. If the eager_load parameter eager_load set to false , this class is not yet required, which will lead to the exclusion of vanilla ruby ββin the program. However, as part of the rails project, testing will require Active::Record as it is used. Thus, in the end, one test is faster because only the parts of the code that it needs are needed.
This method is the opposite of eager_loading and is called autoload.
What is the loaded Rails code and the application that is loading?
Check out https://github.com/rails/rails . This is a bunch of staff.
Are all these classes and their subclasses loaded?
Yes
What are the obvious disadvantages of using eager_load = false in a development or testing environment?
In a development environment, this runs counter to the benefits and best practice, since you get faster load times (ignored when using a preloader such as spring). This probably also makes it easier to reload changes using the cache_classes=false option, since you have less reload (just a guess).
In a test environment, sometimes you simply cannot use eager_loading=false if you want to evaluate some code metrics, for example, code coverage or style checking. For instance. simple_cov requires you to run all the code before starting the tests.
In general, it may happen that some libarary cannot be used with eager_loading because it does some initialization when loading a class that should already be available, even before calling the methods. However, this is the back case, saying that this happened to us with the stone neo4j.rb