mrlegowatch / GarageStorageSwift

A Swift implementation of GarageStorage. Provides a convenient way to store any kind of data in a repository backed by Core Data.
MIT License
8 stars 1 forks source link

Fixes time zone tests including IsoFormatttedDate #15

Closed bobgilmore closed 3 years ago

bobgilmore commented 3 years ago

Accounts for the fact that the Formatter in IsoFormattedDate has its own TimeZone. Since its formatter is tinitalized at class initialization, the test methods (or even the dynamic test setUp methods) set the global time zone too late to affect that object.

The only solution I’ve found is to set it globally on every test class’s class setUp method, thereby ensuring that it will be set at least once before the IsoFormattedDate class is loaded.

mrlegowatch commented 3 years ago

Looks great!