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

Objective-C counterpart for variadic argument contain matcher in Swift #27

Closed
modocache opened this issue Aug 31, 2014 · 1 comment
Closed

Comments

@modocache
Copy link
Member

I can write the following, very convenient, assertion in Swift:

// Swift

expect(["whale", "dolphin", "starfish"]).to(contain("dolphin", "starfish"))

But in Objective-C, I can't pass multiple arguments to contain, so I have to write two lines:

// Objective-C

expect(@[@"whale", @"dolphin", @"starfish"]).to(contain(@"dolphin"));
expect(@[@"whale", @"dolphin", @"starfish"]).to(contain(@"starfish"));

It'd be nice if Objective-C contain supported multiple arguments somehow (the same goes for beginWith and endWith).

@jeffh
Copy link
Member

jeffh commented Sep 18, 2014

For any of these matchers supporting multiple arguments, they need to be converted into a macro that implicitly wraps the arguments into arrays.

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

No branches or pull requests

2 participants