scalacheck
scalacheck copied to clipboard
Properties no longer extends Prop; there is no straightforward way to check all of a Properties group pass
commit 3bec4b1e79f6afd07b8baa3fffa6ecc9acb7a061 removed Properties' subclassing of Prop. This means it's not possible to call check(myProperties).
calling check() on a properties object writes to stderr; doesn't return the result.
This makes it less useable for testing as it's not straightforward to check all properties from a test case.
There's org.scalacheck.Test.checkProperties you can use for this. It's possible that it could be better documented.
scalatest has a nice check() method - is there a nice way convert/wrap a Properties in a Prop that checks all properties in the group? What was the compelling reason to make Properties stop inheriting from Prop?
I believe the change was made to satisfy ScalaJS compatibility.
Can you detail your use case a bit? Why is checkProperties not working out for you?
You can use Prop.all to combine several properties into one, and that was how Properties was converted to Prop before 3bec4b1e79f6afd07b8baa3fffa6ecc9acb7a061. You can use that method, but I fear property failures could be presented in a slightly confusing way.
This was a frustrating issue when upgrading to scalatest 3.0 and scalacheck 1.13.x
@rickynils
def propertiesToProp(properties: Properties) = Prop.all(properties.properties.map(_._2): _*)
does work as a work around.