mardi 17 février 2015

iOS / Xcode: Testing Migrations using xcappdata containers

Assume you have an app that needs to migrate files stored in its directory structure (Documents, Application Support, etc).


Migrations from one file-hierarchy-layout version to another are encapsulated in separate classes. There is a simple forward-only migration runner that runs the migrations from source version to target version in a serial queue.


So far, this is easy.


However, you may want to test your migrations, i.e. "has migration k moved file A to location B?"


In Xcode, you can create a testing target and assign an xcappdata container to be loaded each time tests in that target are run.


However, you may want to test different xcappdata containers. So far, I do not see a way to automate this.


Do you have any suggestions on how to accomplish this?


Aucun commentaire:

Enregistrer un commentaire