Prevent update block called on first time app installed. #25
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey, when using your library in our code, we've found the need to _NOT_ call the
updateBlock
when the application is started from a fresh install. In fact, we've had to code defensively around this case.I have since forked your code and created a private pod, but thought that this change might be something that you would want.
Being a good citizen I've written unit tests around the new method. I found it difficult to mock/change the application version and build numbers as need for my test. So I used a technique called method swizzling to properly mock out these values. See it at the bottom of the unit test class.
In addition I added an example test method to show case how much more powerful these tests can be instead of relying on the test project's bundle values. Seemed pretty important as
MTMigration
core is built around these bundle values.I hope this all makes sense. Let me know what you think.
Thanks for the pod, very helpful otherwise.