-
Notifications
You must be signed in to change notification settings - Fork 64
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
shouldContainAll #100
Comments
@MarkusAmshove I just realized how annoying it is to write tests for both the backtick and non-backtick version. Wouldn't it be better if we had a Spek wrapper that took an Iterable of functions and then ran the specified tests for each of them? Just an idea, which could reduce the test code size by half. |
@AndreasVolkmann I feel you 😃 The intent was to use the tests as a kind of documentation of usage at first, but the number of assertions really exploded after the initial release. It's okay for me if you don't write the backtick tests, because Spek will be removed in the future (atleast for most of the assertions which are platform independent) and I'll migrate the tests to |
I've published 1.37, which contains this change ✔️ |
I think we are missing the
shouldContainAll
type of extensions.This one covers my current use case:
infix fun String.shouldContainAll(items: Iterable<CharSequence>): List<CharSequence> = items.map(::shouldContain)
Instead of:
This should be possible:
sql shouldContainAll ids.map(Int::toString)
But this should also apply to Iterables.
listOf(1) shouldNotContainAll listOf(4)
The text was updated successfully, but these errors were encountered: