I tried
assert(anOption)(contains("x"))
But that only works for Iterables such as List or Seq.
assert(anOption)(isSome(equalTo("x")))
Could also be assert(anOption)(equalTo(Some("x"))) - just using equality. Or if you want to use contains: assert(isTrue(anOption.contains("x"))) using the contains operator on option
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With