A reviewer asked why the unit tests are creating garages in their setup functions to delete all objects when the individual test functions also create their own garages, and the answer is not obvious, which suggests that the sample code should probably be updated to model the right way to initialize a Garage.
The short answer is, when initializing a Garage without any persistent store descriptions, they wind up sharing the same default persistent store description. So, essentially every instance created in this way shares the same local storage. This is actually a bad practice.
Suggestions:
A helper function should be provided for the test code to specify a local storage name
any tests that wish to share their local storage should use the same local storage name
the support for a default shared persistent store description should be removed
A reviewer asked why the unit tests are creating garages in their setup functions to delete all objects when the individual test functions also create their own garages, and the answer is not obvious, which suggests that the sample code should probably be updated to model the right way to initialize a Garage.
The short answer is, when initializing a Garage without any persistent store descriptions, they wind up sharing the same default persistent store description. So, essentially every instance created in this way shares the same local storage. This is actually a bad practice.
Suggestions: