On iOS, I'm using Expecta to test that a certain object's property is of the correct class. Here's my Expecta expectation:
expect(splashController.reachabilityHUD).to.beKindOf([MBProgressHUD class]);
The code under test is:
self.reachabilityHUD = [[MBProgressHUD alloc] initWithView:self.view];
The error returned by the test is:
expected: a kind of MBProgressHUD, got an instance of MBProgressHUD, which is not a kind of MBProgressHUD
As expected, if I drop into lldb
, I get the following:
(lldb) po [splashController.reachabilityHUD class]
MBProgressHUD
(lldb) po [MBProgressHUD class]
MBProgressHUD
I then throw this into the test:
Class actualClass = [splashController.reachabilityHUD class];
Class expectedClass = [MBProgressHUD class];
I print the same output in lldb
. However, the variables view now shows:
expectedClass = (Class) 0x9e58f98
actualClass = (Class) MBProgressHUD
Why is this occurring?