Skip to content

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

Closed

Description

@modocache

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).

Activity

  1. jeffh commented on Sep 18, 2014

    @jeffh
    Member

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

  2. added this to the milestone on Nov 26, 2014
  3. removed this from the v0.4.0 milestone on Feb 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions