Properties

@EnableReflectiveInstantiation class Properties(val name: String)

Represents a collection of properties, with convenient methods for checking all properties at once.

Represents a collection of properties, with convenient methods for checking all properties at once.

Properties are added in the following way:

object MyProps extends Properties("MyProps") {
  property("myProp1") = forAll { (n:Int, m:Int) =>
    n+m == m+n
  }
}
class Object
trait Matchable
class Any

Type members

Classlikes

sealed class PropertySpecifier()

Used for specifying properties. Usage:

Used for specifying properties. Usage:

property("myProp") = ...

Value members

Concrete methods

def check(prms: Parameters): Unit

Convenience method that checks the properties with the given parameters (or default parameters, if not specified) and reports the result on the console. Should only be used when running tests interactively within the Scala REPL.

Convenience method that checks the properties with the given parameters (or default parameters, if not specified) and reports the result on the console. Should only be used when running tests interactively within the Scala REPL.

If you need to get the results from the test use the check methods in org.scalacheck.Test instead.

def include(ps: Properties): Unit

Adds all properties from another property collection to this one

Adds all properties from another property collection to this one

def include(ps: Properties, prefix: String): Unit

Adds all properties from another property collection to this one with a prefix this is prepended to each included property's name.

Adds all properties from another property collection to this one with a prefix this is prepended to each included property's name.

def main(args: Array[String]): Unit

Convenience method that makes it possible to use this property collection as an application that checks itself on execution. Calls System.exit with the exit code set to the number of failed properties.

Convenience method that makes it possible to use this property collection as an application that checks itself on execution. Calls System.exit with the exit code set to the number of failed properties.

Customize the parameters specific to this class.

Customize the parameters specific to this class.

After the command-line (either main above or sbt) modifies the default parameters, this method is called with the current state of the parameters. This method must then return parameters. The default implementation returns the parameters unchanged. However, a user can override this method in a properties subclass. Their method can modify the parameters. Those parameters will take precedence when the properties are executed.

def properties: Seq[(String, Prop)]

Returns all properties of this collection in a list of name/property pairs.

Returns all properties of this collection in a list of name/property pairs.

Concrete fields

val name: String