agusgambina
agusgambina

Reputation: 6699

has ScalaTest an or matcher, testing with PlaySpec Playframework and Scala

I am writing some test in playspec and I want like to write a matcher like this

planPromise.trialPeriodDays mustBe (equal (planRequest.trialPeriodDays) or be (None))

What the matcher is trying to do is to identify if the value is an int (previously defined) or none.

Obviosly is not working.

Is there a way to write this?

Thank you

Upvotes: 0

Views: 401

Answers (1)

Łukasz
Łukasz

Reputation: 8673

Checkout ScalaTest guide here: http://www.scalatest.org/user_guide/using_matchers and search for "Logical expressions with and and or"

here is an example copied from there

option should (equal (Some(List(1, 2, 3))) or be (None))

I guess your problem here is using mustBe instead of must

Upvotes: 1

Related Questions