Objective-C counterpart for variadic argument `contain` matcher in Swift
modocache opened this issue · 1 comments
modocache commented
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 commented
For any of these matchers supporting multiple arguments, they need to be converted into a macro that implicitly wraps the arguments into arrays.