Snippets

org.specs2.execute.Snippets
trait Snippets

Snippets of code can be extracted from interpolated specification strings.

When you want to specify that a piece of code must be included in the specification output, you can use the snippet method to execute a this code and use the text in the output. If you just want to output part of the code you need to delimit it with some comments // 8<------- (with as many dashes >= 2 as you want)

Generally the value of a snippet will not be evaluated nor displayed but it is possible to show it using the eval method on a Snippet.

It is also possible to check that the result value is correct by using the check method.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Type members

Classlikes

implicit class SettableSnippet[T](s: Snippet[T])

implicit function modify the Snippet parameters

implicit function modify the Snippet parameters

Attributes

Supertypes
class Object
trait Matchable
class Any
implicit class SettableSnippet1[T](s: Snippet[T])(implicit evidence$1: AsResult[T])

Attributes

Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

def snippet[T](code: => T)(implicit params: SnippetParams[T]): Snippet[T]

Implicits

Implicits

final implicit def SettableSnippet[T](s: Snippet[T]): SettableSnippet[T]

implicit function modify the Snippet parameters

implicit function modify the Snippet parameters

Attributes

final implicit def SettableSnippet1[T : AsResult](s: Snippet[T]): SettableSnippet1[T]

implicit parameters selected for the creation of Snippets

implicit parameters selected for the creation of Snippets

Attributes