Closed grouchal closed 12 years ago
There shouldn't be any reason that it isn't compatible. Objection has an extensive amount of tests that run on top of Kiwi which is built on top of OCUnit. You can look at the tests under Specs for yourself.
The only way it could be nil
is if it is either not set or it is set to nil
at some other point.
A code example would certainly be useful. But it would also be helpful if you told me:
using via cocoapods and version is 0.13.0 I am using latest xcode 4.4.1
I have debug points in the set and get methods in the JSObjection and can't see at any point that it is reset to nil.
I have created my own InjectorManager that has the same two set and get methods and JSObjection and it works as expected, so the behaviour is limited to JSObjection - but I have no idea why.
That is certainly odd.
Would you mind creating an example project in GitHub that reproduces this issue?
I have tried to reproduce this in an example project but it works in the example - so I will try and spend some time on Friday to work out what the differences are.
Closing it for inactivity.
My unit test currently calls a class called ABTestConfig which creates an injector using a Module and assigns this to the defaultInjector. I have followed this happening in the debugger and can see the value assigned to gGlobalInjector.
When the method in the unit test is run e.g. testExample then this calls another method that tries to get the defaultInjector from JSObjection and I get a nil back. Using the debugger I have confirmed that the value of gGlobalInjector is indeed nil.
Any idea why this is happening?
Is Objection incompatible with unit testing as that would be a real shame!
I will provide code examples if needed.