Open AdrianFerreyra opened 9 years ago
I see the issue now. FOXOptional does produce nils, but NSDictionary and NSArray will box it up into an NSNull since they cannot hold nil values. (Eg. JSON null becomes NSNull).
Unfortunately, Fox currently doesn't have a direct method of producing nil for objc container types. You can emulate it using FOXFrequency (see FOXOptional implementation for an example) and producing dictionaries without those keys.
According to FOX's documentation:
FOXOptional - "Creates a new generator that has a 25% chance of returning nil instead of the provided generated value"
But when I tried to use Optionals in my tests, I get a refence to [NSNull null] singleton. So I alway end up managing this myself in tests.
Can you do anything to directly retrieve a nil pointer?
thanks!