org.specs2.specification

Snippets

trait Snippets extends execute.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 as you want)

Generally the last value of a snippet will be displayed separately but it is possible to avoid this by using the mute method on a Snippet.

It is also possible to check that the result value is equal to a specific value by using the check[R : AsResult](f: T => R) method.

Self Type
Snippets with SpecificationStringContext with FragmentsBuilder with ArgumentsArgs
Linear Supertypes
execute.Snippets, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Snippets
  2. Snippets
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. implicit class SettableSnippet[T] extends AnyRef

    implicit function modify the Snippet parameters

  2. implicit class SettableSnippet1[T] extends AnyRef

    Definition Classes
    Snippets

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def createSnippet[T](rangepos: Boolean, expression: String, code: ⇒ T, params: SnippetParams[T]): Snippet[T]

    Definition Classes
    Snippets
  9. implicit def defaultSnippetParameters[T]: SnippetParams[T]

    implicit parameters selected for the creation of Snippets

    implicit parameters selected for the creation of Snippets

    Definition Classes
    Snippets
  10. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  12. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. def fullName[T](implicit arg0: scala.reflect.api.JavaUniverse.WeakTypeTag[T]): String

    Definition Classes
    Snippets
  14. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  15. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  16. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  17. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  18. final def notify(): Unit

    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  20. def simpleName[T](implicit arg0: scala.reflect.api.JavaUniverse.WeakTypeTag[T]): String

    Definition Classes
    Snippets
  21. def snippet[T](code: ⇒ T)(implicit params: SnippetParams[T]): Snippet[T]

    Definition Classes
    Snippets
    Annotations
    @macroImpl( ... )
  22. implicit def snippetIsSpecPart[T](snippet: Snippet[T]): SpecPart

  23. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  24. def termName(m: Any): String

    Definition Classes
    Snippets
    Annotations
    @macroImpl( ... )
  25. def toString(): String

    Definition Classes
    AnyRef → Any
  26. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from execute.Snippets

Inherited from AnyRef

Inherited from Any

Ungrouped