-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
beInstanceOf causes failing test when it should pass #155
Comments
Could it be that you have the framework containing |
Well my Podfile has this already...
|
I have the same problem with a subclass of UIView. In the case of beKindOf: expect(_viewController.introView).to.beKindOf([EAIntroView class]); // this fails
expect(_viewController.introView).to.beKindOf([UIView class]); // this passes In the case of beInstanceOf both of the expectations fail expect(_viewController.introView).to.beInstanceOf([EAIntroView class]); // this fails
expect(_viewController.introView).to.beInstanceOf([UIView class]); // this fails PS. I have a test ensuring that the instance is not nil which passes |
It's not really possible to debug this without knowing what's going on in Does NSAssert([_viewController.introView isKindOfClass: EAIntroView.class], @"Expected %@ to an instance of EAIntroView", _viewController.introView) throw an assertion for you? If so, it seems like |
You were right, using CocoaPods to manage my dependencies I was adding to the test target all dependencies from the main target, adding
|
I'm reopening this issue, originally reported as #123. This matcher is broken, or at least the description of its use is incorrect:
According to that description, as long as the comparison object on the left is exactly of type
[Foo class]
then the test should pass. In comparison, the companion matcher:Implies that the comparison object on the left could be either of type
[Foo class]
or a subclass.I'm getting the exact result as the original reporter:
What I'm expecting, is to get the same result as returned by:
Either the implementation is incorrect, the documentation is incorrect, or the error is incorrect.
The text was updated successfully, but these errors were encountered: