I've been using ScalaTest FeatureSpec for a couple of days now, and I'm trying to figure out if the following specification can be determined using the built-in mappings (and if not, how can I write a suitable custom mapper).
Suppose I have a Book class:
case class Book(val title: String, val author: String)
and in my test I have a List of books:
val books = List(Book("Moby Dick", "Melville"))
Now I would like to point out that the book list should contain a book called "Moby Dick". I would like to write something like:
books should contain (value with title "Moby Dick")
I can’t understand from the docs and code if this can be expressed in ScalaTest. Has anyone encountered a similar situation?
source
share