the actual value as either Right(value) or Left(result)
The apply method sets the expected value and returns the Prop
do the decoration
do the decoration
set a new Decorator for the label
set a new Decorator for the label
do the decoration
do the decoration
set a new Decorator for the value
set a new Decorator for the value
set a new Decorator
set a new Decorator
set a new Decorator
set a new Decorator
execute the constraint set on this property, with the expected value
execute the constraint set on this property, with the expected value
a Result
the expected value as an option
return the label styles
return the label styles
modify the result to return
modify the result to return
set a specific constraint on the property
set a specific result on the property
set a new style for the label
set a new style for the label
set a new style for the value
set a new style for the value
set a new style
set a new style
Display the property:
Display the property:
label: "this" (actual: "that")
The Prop class is a named property which holds:
This property can be executed and can be inserted in a Form.
A Prop is meant to be declared as "bound" to an actual value:
val customerName = Prop("Customer name", person.name)
[the actual value is not evaluated until the Prop is executed]
Then it can be associated an expected value with the apply method (usually in a Form declaration):
customerName("Bill")
The actual and the expected values can have different types and the constraint which is applied to them can be anything returning a result.
However the Prop companion object provides a method to create a Property with a constraint using a beEqualTo matcher:
Prop("Name", "Eric")("Eric") must_== Success("'Eric' is equal to 'Eric'")