Trait

org.specs2.specification

Snippets

Related Doc: package specification

Permalink

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 S2StringContextCreation with FragmentsFactory
Linear Supertypes
execute.Snippets, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Snippets
  2. Snippets
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. implicit class SettableSnippet[T] extends AnyRef

    Permalink
    Definition Classes
    Snippets
  2. implicit class SettableSnippet1[T] extends AnyRef

    Permalink
    Definition Classes
    Snippets

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

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

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  10. def fullName[T](implicit arg0: scala.reflect.api.JavaUniverse.WeakTypeTag[T]): String

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

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  12. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  13. final def isInstanceOf[T0]: Boolean

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

    Permalink
    Definition Classes
    AnyRef
  15. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  16. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  17. def simpleName[T](implicit arg0: scala.reflect.api.JavaUniverse.WeakTypeTag[T]): String

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

    Permalink
    Definition Classes
    Snippets
  19. implicit def snippetIsSpecPart[T](snippet: Snippet[T]): InterpolatedFragment

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

    Permalink
    Definition Classes
    AnyRef
  21. macro def termName(m: Any): String

    Permalink
    Definition Classes
    Snippets
  22. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  23. final def wait(arg0: Long, arg1: Int): Unit

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @Deprecated @deprecated @throws( classOf[java.lang.Throwable] )
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from execute.Snippets

Inherited from AnyRef

Inherited from Any

Ungrouped