org.specs2.form

package org.specs2.form

Members list

Type members

Classlikes

trait Card extends Specification, Snippets

This trait defines a simple tab with a title and some text.

This trait defines a simple tab with a title and some text.

The text will be interpreted as Markdown text when rendered as html

Attributes

Supertypes
trait Snippets
trait Snippets
class Specification
trait SpecificationLike
trait SpecificationFeatures
trait ImplicitExecutionContexts
trait ImplicitExecutionContextFromExecutionEnv
trait Debug
trait PendingUntilFixed
trait ResultLogicalCombinators
trait Results
trait MatcherImplicits
trait ExpectedResults
trait StandardResults
trait Expectations
trait ExpectationsDescription
trait ShouldMatchers
trait ShouldExpectations
trait MustMatchers
trait MustExpectations
trait TypedEqual
trait Matchers
trait FutureMatchers
trait EventuallyMatchers
trait EventuallyResults
trait TryMatchers
trait EitherMatchers
trait OptionMatchers
trait ValueChecks
trait ValueChecksBase
trait NumericMatchers
trait ExceptionMatchers
trait ExpectationsCreation
trait ResultChecks
trait MatchResultStackTrace
trait StringMatchers
trait MapMatchers
trait TraversableMatchers
trait NumberOfTimes
trait ValueChecksLowImplicits
trait TraversableBaseMatchers
trait AnyMatchers
trait SpecificationCreation
trait FormattingFragments
trait S2StringContext
trait S2StringContextCreation
trait ArgumentsShortcuts
trait ArgumentsArgs
trait ArgProperties
trait ArgumentsCreation
trait AutoExamples
trait AcceptanceDsl
trait ReferenceDsl
trait ExampleDsl
trait TitleDsl
trait FragmentsDsl
trait ActionDsl
trait TagDsl
trait ReferenceCreation
trait SpecStructureDsl
trait FragmentsFactory
trait ImmutableSpecificationStructure
trait SpecificationStructure
class Object
trait Matchable
class Any
Show all
trait Cards

A set of tabs with a title, where each tab simply contains some text

A set of tabs with a title, where each tab simply contains some text

Attributes

Supertypes
class Object
trait Matchable
class Any
trait Cell extends Text, Xml, Executable

A Cell is the Textual or Xml representation of a Form element: Field, Prop or Form. A more general XmlCell is also available to be able to input any kind of Xml inside a Form

A Cell is the Textual or Xml representation of a Form element: Field, Prop or Form. A more general XmlCell is also available to be able to input any kind of Xml inside a Form

A Cell can be executed by executing the underlying element but also by setting the cell to a specific result (success or failure). This feature is used to display rows of values with were expected and found ok in Forms.

Attributes

Supertypes
trait Executable
trait Xml
trait Text
class Object
trait Matchable
class Any
Show all
Known subtypes
class EffectCell
class FieldCell
class FormCell
class LazyCell
class PropCell
class Tab
class Tabs
class TextCell
class XmlCell
Show all
trait Constraint[T]

Base class for constraints executed on an optional expected value.

Base class for constraints executed on an optional expected value.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class FunctionConstraint[T, S]
trait DecoratedLabel[T]

A DecoratedLabel holds a decorator and delegates decoration and styling operations to that Decorator

A DecoratedLabel holds a decorator and delegates decoration and styling operations to that Decorator

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Effect[T]
class Field[T]
class Prop[T, S]
class TextCell
trait DecoratedProperty[T] extends DecoratedLabel[T]

A DecoratedLabel holds a decorator and delegates decoration and styling operations for values and labels to that Decorator

A DecoratedLabel holds a decorator and delegates decoration and styling operations for values and labels to that Decorator

Attributes

Supertypes
trait DecoratedLabel[T]
class Object
trait Matchable
class Any
Known subtypes
class Effect[T]
class Field[T]
class Prop[T, S]
class TextCell
case class Decorator(label: Any => Any, value: Any => Any, labelStyles: Seq[String], valueStyles: Seq[String])

This class contains functions to decorate and style a label and a value:

This class contains functions to decorate and style a label and a value:

  • with a function taking the xml for the label/value and returning some xml
  • with some xml attributes "name":"value" to style those labels/values

The methods of that class allow to stack new decoration, new styling attributes but also define standard decoration and styles for bold / italic / centered ... text.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class Effect[T](label: String, value: Property[T], decorator: Decorator) extends Executable, DecoratedProperty[Effect[T]]

An Effect is a property which is used to display names corresponding to side-effects.

An Effect is a property which is used to display names corresponding to side-effects.

If the side effect throws an exception, the Effect will display it alongside to the label. Otherwise only the label is displayed.

The apply method can be used to execute the Effect effect and possibly get a value out of it (but usually not displayed): Effect(label, 1).apply() must ===(1)

The value is stored in a Property object so it will not be evaluated until explicitly queried.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait Executable
class Object
trait Matchable
class Any
Show all
case object Effect

Factory methods for creating Effects. Effects values can also be concatenated to produce "summary" effects.

Factory methods for creating Effects. Effects values can also be concatenated to produce "summary" effects.

val e1 = Effect("hello", print("hello")) val e2 = Effect("world", print("world")) val concatenatedEffects = Effect(e1, e2) concatenatedEffects.toString == hello/world

val concatenatedEffect = Effect(", ", e1, e2) concatenatedEffects2.toString == hello, world

Attributes

Companion
class
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type
Effect.type
case class EffectCell(e: Effect[_], result: Option[Result]) extends Cell

Cell embedding a Eff

Cell embedding a Eff

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Cell
trait Executable
trait Xml
trait Text
class Object
trait Matchable
class Any
Show all
case class Field[T](label: String, value: Property[T], decorator: Decorator) extends Executable, DecoratedProperty[Field[T]]

A Field is a property which is used only to display input values or output values.

A Field is a property which is used only to display input values or output values.

The apply method can be used to retrieve the Field value: Field(label, 1).apply() must ===(1)

The value is stored in a Property object so it will not be evaluated until explicitly queried

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait DecoratedLabel[Field[T]]
trait Executable
class Object
trait Matchable
class Any
Show all
case object Field

Factory methods for creating Fields. Fields values can also be concatenated to produce "summary" fields.

Factory methods for creating Fields. Fields values can also be concatenated to produce "summary" fields.

val f1 = Field(label, "hello") val f2 = Field(label, "world") val concatenatedFields = Field(label, f1, f2) concatenatedFields.toString == label: hello/world

val concatenatedFields2 = Field(label, ", ", f1, f2) concatenatedFields2.toString == label: hello, world

Attributes

Companion
class
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type
Field.type
case class FieldCell(f: Field[_], result: Option[Result]) extends Cell

Cell embedding a Field

Cell embedding a Field

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Cell
trait Executable
trait Xml
trait Text
class Object
trait Matchable
class Any
Show all
class Form(val title: Option[String], val rows: Seq[Row], val result: Option[Result]) extends Executable, Text

A Form is a container for Rows (@see Row) where each row contain some Cell (@see Cell). It has an optional title and possibly no rows.

A Form is a container for Rows (@see Row) where each row contain some Cell (@see Cell). It has an optional title and possibly no rows.

A Form can be executed by executing each row and collecting the results.

Attributes

Companion
object
Supertypes
trait Text
trait Executable
class Object
trait Matchable
class Any
Known subtypes
class InlinedForm
case object Form

Companion object of a Form to create:

Companion object of a Form to create:

  • an empty Form
  • a Form with no rows but a title
  • a Form with no title but one row

Attributes

Companion
class
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type
Form.type
class FormCell(_form: => Form, result: Option[Result]) extends Cell

Cell embedding a Form

Cell embedding a Form

Attributes

Companion
object
Supertypes
trait Cell
trait Executable
trait Xml
trait Text
class Object
trait Matchable
class Any
Show all
object FormCell

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
FormCell.type
object FormDiffs

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
FormDiffs.type

Attributes

Supertypes
class Object
trait Matchable
class Any
case class FunctionConstraint[T, S](actual: T, executor: (T, T) => Result) extends Constraint[T]

This general constraint uses a function taking an actual value and an expected value to do the match.

This general constraint uses a function taking an actual value and an expected value to do the match.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Constraint[T]
class Object
trait Matchable
class Any
Show all
trait HasForm[T]

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object given_HasForm_Form.type
trait HasLabel

generic trait for anything having a label, to unify Props and Forms

generic trait for anything having a label, to unify Props and Forms

Attributes

Supertypes
class Object
trait Matchable
class Any
class InlinedForm(title: Option[String], rows: Seq[Row], result: Option[Result]) extends Form

This Form overrides the toXml and text methods so that it appears seamlessly included in another Form.

This Form overrides the toXml and text methods so that it appears seamlessly included in another Form.

Attributes

Supertypes
class Form
trait Text
trait Executable
class Object
trait Matchable
class Any
Show all
class LazyCell(_cell: => Cell) extends Cell

Proxy to a cell that's not evaluated right away when added to a row

Proxy to a cell that's not evaluated right away when added to a row

Attributes

Companion
object
Supertypes
trait Cell
trait Executable
trait Xml
trait Text
class Object
trait Matchable
class Any
Show all
object LazyCell

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
LazyCell.type
case class Prop[T, S](label: String, actual: Property[T], expected: Property[S], constraint: (T, S) => Result, decorator: Decorator) extends Executable, DecoratedProperty[Prop[T, S]]

The Prop class is a named property which holds:

The Prop class is a named property which holds:

  • an actual value
  • an expected value
  • a constraint to check if the actual value conforms to the expected one

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'"))

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait DecoratedProperty[Prop[T, S]]
trait DecoratedLabel[Prop[T, S]]
trait Executable
class Object
trait Matchable
class Any
Show all
object Prop

Companion object with factory methods

Companion object with factory methods

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Prop.type
case class PropCell(p: Prop[_, _], result: Option[Result]) extends Cell

Cell embedding a Prop

Cell embedding a Prop

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Cell
trait Executable
trait Xml
trait Text
class Object
trait Matchable
class Any
Show all
trait PropSyntax

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Forms
object Forms.type
case class Row(cellList: List[Cell]) extends Executable

A Row is a non-empty list of Cells

A Row is a non-empty list of Cells

A Row can be executed by executing each Cell and collecting the results.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait Executable
class Object
trait Matchable
class Any
Show all
case object Row

Companion object of a Row to create a Row with at least one cell

Companion object of a Row to create a Row with at least one cell

Attributes

Companion
class
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type
Row.type
case class Tab(title: String, form: Form, result: Option[Result]) extends Cell

Class representing an individual tab

Class representing an individual tab

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Cell
trait Executable
trait Xml
trait Text
class Object
trait Matchable
class Any
Show all
case class Tabs(tabs: Seq[Tab], result: Option[Result]) extends Cell

This class allows the creation of tabs to embed several forms at once on a limited html space

This class allows the creation of tabs to embed several forms at once on a limited html space

Attributes

See also

org.specs2.examples.FormSpec

Supertypes
trait Serializable
trait Product
trait Equals
trait Cell
trait Executable
trait Xml
trait Text
class Object
trait Matchable
class Any
Show all
trait Text

Base type for anything returning some text

Base type for anything returning some text

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Cell
class EffectCell
class FieldCell
class FormCell
class LazyCell
class PropCell
class Tab
class Tabs
class TextCell
class XmlCell
class Form
class InlinedForm
Show all
case class TextCell(s: String, result: Option[Result], decorator: Decorator) extends Cell, DecoratedProperty[TextCell]

Simple Cell embedding an arbitrary String

Simple Cell embedding an arbitrary String

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait Cell
trait Executable
trait Xml
trait Text
class Object
trait Matchable
class Any
Show all
object TextCell

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
TextCell.type
trait ToCell[T]

Attributes

Supertypes
class Object
trait Matchable
class Any
trait Xml

Base type for anything returning some xml

Base type for anything returning some xml

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Cell
class EffectCell
class FieldCell
class FormCell
class LazyCell
class PropCell
class Tab
class Tabs
class TextCell
class XmlCell
Show all
object Xml

utility functions for creating xml for Cells

utility functions for creating xml for Cells

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Xml.type
class XmlCell(_theXml: => NodeSeq) extends Cell

This cell can contain any xml

This cell can contain any xml

Attributes

Companion
object
Supertypes
trait Cell
trait Executable
trait Xml
trait Text
class Object
trait Matchable
class Any
Show all
object XmlCell

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
XmlCell.type
object given_HasForm_Form extends HasForm[Form]

Attributes

Supertypes
trait HasForm[Form]
class Object
trait Matchable
class Any
Self type

Givens

Givens

given given_HasForm_T[T <: { def form: Form; }]: given_HasForm_T[T]