Closed baumatron closed 7 years ago
I did want to ask, just to be sure, if anywhere else in the tests calls setProjectID and sets it to nil? If that runs before the teardown, that would be the same problem, right? I imagine you checked that, but just in case...
Yeah, there aren't tests that are setting projectId to nil. There is one where sharedClientWIthProjectID:nil is called, but that short circuits when it validates the parameter and returns nil before actually assigning the project id.
KeenClient's sharedClient returns nil when no projectid is set, which leads to nasty side-effects for test setup. Basically, any write or read key that was set wasn't getting cleared by setUp because of this, and neither was currentLocation.
The workaround is to carefully reset state to defaults and set the projectid to nil last. Changes to sharedClient behavior proposed by PR #193 will improve this situation because sharedClient will no longer return nil.