Synesso
Synesso

Reputation: 38988

ScalaCheck spec seeking Matcher[String] after upgrade

After upgrading from specs 2.4.13 to 3.7.1

"foo" should {
  "bar" >> prop((i: Int) =>
    i % 50 must be>= 0
  )
}

no longer compiles. It fails with

type mismatch;
[error]  found   : org.specs2.specification.core.Fragment
[error]  required: org.specs2.matcher.Matcher[String]
[error]     "bar" >> prop((i: Int) =>
[error]           ^

Changing it to

  "foo" >> {
    "bar" >> prop((i: Int) =>
      i % 50 must be>= 0
    )
  }

will allow it to compile and pass.

Has the behaviour of should been changed?

Upvotes: 0

Views: 55

Answers (1)

Eric
Eric

Reputation: 15557

I don't get such error in 3.8.8. However this might be the result of should being used for a block of examples and should as a matcher construct (a should be_>=(0)).

You can remove the latter usage by mixing-in org.specs2.matcher.NoShouldExpectations

Upvotes: 1

Related Questions