Map matchers (havePair(s), haveValue(s)) and value matchers

13 views
Skip to first unread message

Daniel Shmuglin

unread,
Mar 21, 2017, 4:14:21 AM3/21/17
to specs2-users
Eric, hey.

Is there a built-in way to pass a matcher for value within map matchers?
I'd like to do something like:

val myMap: Map[String, String] = ???
myMap must havePairs("key1" -> startsWith("prefix"))

I've seen the ValueCheck[T] abstraction. Maybe it might help?

Thanks. 

Daniel

etorreborre

unread,
Mar 21, 2017, 4:23:25 AM3/21/17
to specs2-users
No there isn't but arguably there should be. PR welcome :-).

If you don't have time for a PR, please create an issue for it on github.

Daniel Shmuglin

unread,
Mar 21, 2017, 4:26:15 AM3/21/17
to specs2-users

I'd be happy to make a PR, though no promise on time frame :)

Thanks!

Do you want me also to open an issue, just for doc?

etorreborre

unread,
Mar 21, 2017, 4:30:39 AM3/21/17
to specs2-users
Not necessary, a PR will do.
Reply all
Reply to author
Forward
0 new messages