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

Make non variadic contains matchers public #297

Merged
merged 1 commit into from
May 21, 2016

Conversation

stigi
Copy link

@stigi stigi commented May 21, 2016

Currently we can match for expect([1, 2, 3]).to(contain(1, 2)) but we can not match expect([1, 2, 3]).to(contain([1, 2])). The matching functions are already present, and I don't see the reason for them to not be public.

This makes the following scenario easier to write:

    expect(zoo.catsAndDogs).to(contain(zoo.cats))
    expect(zoo.catsAndDogs).to(contain(zoo.dogs))

There's also a swift bug filed that would support this use case out of the box, but it's still open: https://bugs.swift.org/browse/SR-128

This allows matching for an collection to contain a slice of itself and
bypasses an open issue in Swift 2 https://bugs.swift.org/browse/SR-128
@ashfurrow
Copy link
Member

Fab!

@ashfurrow ashfurrow merged commit f24eac6 into Quick:master May 21, 2016
Megal pushed a commit to Megal/Nimble that referenced this pull request Jul 31, 2019
Make non variadic contains matchers public
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.

2 participants