Open manuyavuz opened 8 years ago
While I was converting my XCTAssert macros to expect macros, I wrongly copy/pasted actual value as following:
XCTAssert
expect
expect([request class]).to.beAMemberOf([MyRequest class]);
where it should have been:
expect(request).to.beAMemberOf([MyRequest class]);
Is this case, expecta failed with the following message:
expected: an instance of MyRequest, got: an instance of MyRequest
which obviously look weird. Could we improve this? We can check if given value is a class struct with the following conditional:
if ([actual class] == actual) { // A class struct } else { // An instance }
But I'm not sure if making that check only in EXPMatchers+beInstanceOf file enough to handle all cases.
EXPMatchers+beInstanceOf
If you feel this change is enough, I can move for a PR.
Thanks
Yep - this makes sense, definitely
While I was converting my
XCTAssert
macros toexpect
macros, I wrongly copy/pasted actual value as following:where it should have been:
Is this case, expecta failed with the following message:
which obviously look weird. Could we improve this? We can check if given value is a class struct with the following conditional:
But I'm not sure if making that check only in
EXPMatchers+beInstanceOf
file enough to handle all cases.If you feel this change is enough, I can move for a PR.
Thanks