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

RespondsTo matcher added #132

Merged
merged 4 commits into from
Oct 31, 2013
Merged

RespondsTo matcher added #132

merged 4 commits into from
Oct 31, 2013

Conversation

AlexDenisov
Copy link
Contributor

With this matcher you're able to check if class or instance responds to some selector, via @selector or NSString, e.g.:

[NSObject class] should responds_to(@selector(new));
@"Buzz" should responds_to(@"length");

@idoru
Copy link
Contributor

idoru commented Oct 29, 2013

Thank you for your contribution.

Could you change the wording from responds_to to respond_to?

Also, we prefer to use NSSelectorFromString() for non-existent selectors in our codebase, rather than ignoring the diagnostic.

@AlexDenisov
Copy link
Contributor Author

Ok, I will update this PR.

@AlexDenisov
Copy link
Contributor Author

@idoru, done. Could you review changes?

@jeffh
Copy link
Contributor

jeffh commented Oct 29, 2013

Shouldn't it be a cstring instead of NSString to be similar to have_received and the like?

@AlexDenisov
Copy link
Contributor Author

@jeffh, that's make sense. What about third one method with cstring in addition to the existing methods?

@jeffh
Copy link
Contributor

jeffh commented Oct 29, 2013

That works.


Sent from my iPhone

On Tue, Oct 29, 2013 at 12:52 PM, Alexey Denisov notifications@github.com
wrote:

@jeffh, that's make sense. What about third one method with cstring in addition to the existing methods?

Reply to this email directly or view it on GitHub:
#132 (comment)

@AlexDenisov
Copy link
Contributor Author

That works.

What do you mean?

@idoru
Copy link
Contributor

idoru commented Oct 29, 2013

Good catch @jeffh.

We should ensure both SEL and c-strings are supported (for consistency with HaveReceived).

Supporting NSString would make it inconsistent with other method name matchers; The c-string format was provided as a short-hand, is there a reason why NSString would be useful? If so, we'll add it with a mind to support NSString elsewhere in future. If not, I think just SEL and c-strings are all we should support.

@AlexDenisov
Copy link
Contributor Author

@idoru, I got it.

idoru added a commit that referenced this pull request Oct 31, 2013
@idoru idoru merged commit c251ec9 into cedarbdd:master Oct 31, 2013
@idoru
Copy link
Contributor

idoru commented Oct 31, 2013

Great!

Thanks for your contribution and being so flexible.

@AlexDenisov
Copy link
Contributor Author

You're welcome!

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

Successfully merging this pull request may close these issues.

3 participants