Skip to content
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

Give more descriptive message on beInstanceOf when Class is passed in expect. #180

Open
manuyavuz opened this issue Dec 2, 2015 · 1 comment

Comments

@manuyavuz
Copy link

While I was converting my XCTAssert macros to expect macros, I wrongly copy/pasted actual value as following:

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.

If you feel this change is enough, I can move for a PR.

Thanks

@orta
Copy link
Member

orta commented Apr 10, 2016

Yep - this makes sense, definitely

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants