Closed joeljfischer closed 7 years ago
Also seeing this error elsewhere:
Could not cast value of type 'OCClassMockObject' (0x111f31518) to 'Swift.CustomDebugStringConvertible' (0x111e590e8).
for this code:
__block id fileManagerMock = OCMClassMock([SDLFileManager class]);
// ...
expect(testManager.fileManager).toNot(beNil());
It feels like there are a lot of moving parts and I'm not sure I fully understand yet what you're doing.
It's clear that you are using the Nimble framework. From looking at its page on Github it looks like it's written in Swift but can be used from Objective-C, right? Based on the code snippet in your second comment I assume your tests are written in Objective-C, right?
Now, it sounds like you've updated the version of Nimble and kept the same version of OCMock. After the update of Nimble, some of your tests are breaking with this error you mention. If I understand you correctly the error occurs in the function you included in the issue. Where exactly? What are the arguments?
Could you provide a small self-contained tests that always fails?
@joeljfischer I think this error should be fixed within Nimble itself. Could you close this issue and create one on the Nimble repository instead?
As the error message indicates, OCClassMockObject
cannot be converted to Swift's CustomDebugStringConvertible
protocol -- meaning, as far as I can tell, it doesn't implement -debugDescription
. Nimble's stringify
function attempts to handle cases in which the subject of an expectation doesn't conform to CustomDebugStringConvertible
, so I'm not sure why it's failing here. But I think we can fix the problem in Nimble, rather than forcing OCMock code to change.
Closing due to inactivity. Hopefully this has been fixed by the Nimble team. @modocache?
Thanks, @erikdoe, I created an issue on the Nimble repository to track this.
I'm seeing a crash when running tests using the Swift 3 version of Quick / Nimble that I was not seeing on the Swift 2.3 version.
The test code causing the error:
The location it's breaking
with this error: