org.specs2.execute

Members list

Type members

Classlikes

class AnyValueAsResult[T] extends AsResult[T]

Type class to transform any value to a Result

Type class to transform any value to a Result

Attributes

Supertypes
trait AsResult[T]
class Object
trait Matchable
class Any
trait AsResult[T]

Typeclass trait for anything that can be transformed to a Result

Typeclass trait for anything that can be transformed to a Result

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class AnyValueAsResult[T]
object booleanAsResult.type
object given_AsResult_Unit.type

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
AsResult.type

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object AsResult.type
object BestMatching

Use of the Hopcroft-Karp (https://en.wikipedia.org/wiki/Hopcroft%E2%80%93Karp_algorithm) algorithm for specs2, to the minimum set of mismatched elements, and corresponding failures

Use of the Hopcroft-Karp (https://en.wikipedia.org/wiki/Hopcroft%E2%80%93Karp_algorithm) algorithm for specs2, to the minimum set of mismatched elements, and corresponding failures

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
case class DecoratedResult[+T](decorator: T, result: Result) extends Result

This result allows to embed additional data with a given result for further display

This result allows to embed additional data with a given result for further display

Is is used to provide a way to display properly the data tables in the HtmlExporter

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Result
class Object
trait Matchable
class Any
Show all
Self type

this class allows to throw a result that's decorated with additional information in an Exception

this class allows to throw a result that's decorated with additional information in an Exception

Attributes

Supertypes
trait Product
trait Equals
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
sealed trait Details

Trait to model detailed information for failures so that smart differences can be computed

Trait to model detailed information for failures so that smart differences can be computed

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object FromExpectationError.type
object FromTimeoutException.type
object NoDetails.type
Show all
case class Error(m: String, t: Throwable) extends Result, ResultStackTrace

This class represents an exception occurring during an execution.

This class represents an exception occurring during an execution.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Result
class Object
trait Matchable
class Any
Show all
Self type
case object Error

This object allows to create an Error from an exception

This object allows to create an Error from an exception

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
Error.type
case class ErrorException(f: Error) extends ExecuteException

this class allows to throw an Error result in an Exception

this class allows to throw an Error result in an Exception

Attributes

Supertypes
trait Product
trait Equals
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all

This trait adds the possibility to retry a given value, convertible to a result, until it succeeds.

This trait adds the possibility to retry a given value, convertible to a result, until it succeeds.

This was adapted from a contribution by @robey (http://robey.lag.net)

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object EventuallyResults.type

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
trait Executable

Trait for anything that can be executed to return a Result

Trait for anything that can be executed to return a Result

Attributes

Supertypes
class Object
trait Matchable
class Any
trait ExecuteException extends Exception

Attributes

Supertypes
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
Known subtypes
case class Failure(m: String, e: String, trace: List[StackTraceElement], details: Details) extends Result, ResultStackTrace

This class represents the failure of an execution. It has a message and a stacktrace

This class represents the failure of an execution. It has a message and a stacktrace

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Result
class Object
trait Matchable
class Any
Show all
Self type
case class FailureDetails(actual: String, expected: String) extends Details

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Details
class Object
trait Matchable
class Any
Show all
case class FailureDetailsMessages(messages: List[String]) extends Details

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Details
class Object
trait Matchable
class Any
Show all
case class FailureException(f: Failure) extends ExecuteException

this class allows to throw a failure result in an Exception

this class allows to throw a failure result in an Exception

Attributes

Supertypes
trait Product
trait Equals
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
case object FromExpectationError extends Details

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Details
class Object
trait Matchable
class Any
Show all
Self type
case object FromJUnitAssertionError extends Details

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Details
class Object
trait Matchable
class Any
Show all
Self type
case object FromNotImplementedError extends Details

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Details
class Object
trait Matchable
class Any
Show all
Self type
case object FromTimeoutException extends Details

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Details
class Object
trait Matchable
class Any
Show all
Self type
class Function0Result(var t: () => Result)

This class is used to delay the execution of a result

This class is used to delay the execution of a result

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
case class MyClass(list: List[_])

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case object NoDetails extends Details

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Details
class Object
trait Matchable
class Any
Show all
Self type
NoDetails.type
case class Pending(m: String) extends Result

Pending result

Pending result

Attributes

See also

Result for description

Supertypes
trait Serializable
trait Product
trait Equals
class Result
class Object
trait Matchable
class Any
Show all
Self type
case class PendingException(f: Pending) extends ExecuteException

this class allows to throw a pending result in an Exception

this class allows to throw a pending result in an Exception

Attributes

Supertypes
trait Product
trait Equals
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
sealed abstract class Result(val message: String, val expected: String)

The result of an execution, either:

The result of an execution, either:

  • a success: the execution is ok
  • a failure: an expectation is not met
  • an error: an exception occurred
  • a pending execution: the user has decided that execution must not be performed
  • a skipped execution: based on dynamic conditions (a database not available for instance) the execution is not performed

A Result has:

  • a message describing the outcome
  • a message describing the expectation
  • possibly a number of expectations when it is the outcome of several checks (this is used for the reporting of ScalaCheck properties).

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class DecoratedResult[T]
class Error
class Failure
class Pending
class Skipped
class Success
Show all
object Result

Attributes

Companion
class
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Result.type

This trait executes a Result and returns an appropriate value when a specs2 exception is thrown

This trait executes a Result and returns an appropriate value when a specs2 exception is thrown

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object ResultExecution.type
Self type

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type

This trait adds some implicits to easily fold sequences of results

This trait adds some implicits to easily fold sequences of results

Attributes

Companion
object
Supertypes
trait Results
class Object
trait Matchable
class Any
Known subtypes
object ResultImplicits.type

Attributes

Companion
trait
Supertypes
trait Results
class Object
trait Matchable
class Any
Show all
Self type

This trait provides logical combinators for Booleans and Results: and, or, not

This trait provides logical combinators for Booleans and Results: and, or, not

Note that a Result expression can throw an exception which will be changed into a failure or an error before being used with and/or/not

The implicit definitions can not be easily replaced with extension methods otherwise this brings too many conflicts with the synthetized method names, like extension_and for both the extension for a Boolean value and a Result

Attributes

Companion
object
Supertypes
trait Results
class Object
trait Matchable
class Any
Known subtypes

Attributes

Companion
trait
Supertypes
trait Results
class Object
trait Matchable
class Any
Self type

The stacktrace for a Result

The stacktrace for a Result

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Error
class Failure
trait Results

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Results extends Results

Attributes

Companion
trait
Supertypes
trait Results
class Object
trait Matchable
class Any
Self type
Results.type
case class ScissorsCutter(cutMarker: String, cutMarkerFormat: String) extends String => String

Implementation of a function to cut pieces of code by using some comments as markers

Implementation of a function to cut pieces of code by using some comments as markers

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait String => String
class Object
trait Matchable
class Any
Show all
case class SkipException(f: Skipped) extends ExecuteException

this class allows to throw a skipped result in an Exception

this class allows to throw a skipped result in an Exception

Attributes

Supertypes
trait Product
trait Equals
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
case class Skipped(m: String, e: String) extends Result

Skipped result

Skipped result

Attributes

See also

Result for description

Supertypes
trait Serializable
trait Product
trait Equals
class Result
class Object
trait Matchable
class Any
Show all
Self type
case class Snippet[T](code: () => T, codeExpression: Option[String], params: SnippetParams[T])

Captured snippet of code with: a value of type T, a string representing the expression, captured by a macro, some evaluation and display parameters

Captured snippet of code with: a value of type T, a string representing the expression, captured by a macro, some evaluation and display parameters

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Snippet

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Snippet.type
case class SnippetParams[T](trimExpression: String => String, cutter: String => String, asCode: (String, String) => String, prompt: String => String, evalCode: Boolean, verify: Option[T => Result])

Evaluation and display parameters for a Snippet.

Evaluation and display parameters for a Snippet.

It is possible to change:

  • the function that's trimming the expression from newlines or accolades
  • the cutter function to remove part which must not be shown
  • the asCode function to render the resulting text
  • the prompt function to possibly display the evaluated result with a prompt
  • the eval boolean indicating if a snippet must be evaluated
  • the verify function checking the result

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
trait Snippets

Snippets of code can be extracted from interpolated specification strings.

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

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Snippets.type
object Snippets extends Snippets

Attributes

Companion
trait
Supertypes
trait Snippets
class Object
trait Matchable
class Any
Self type
Snippets.type

This trait provides standard results which can be used in Fragments bodies

This trait provides standard results which can be used in Fragments bodies

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object StandardResults.type

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
case class Success(m: String, exp: String) extends Result

This class represents the success of an execution

This class represents the success of an execution

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Result
class Object
trait Matchable
class Any
Show all
object Success

Companion object to the Success class providing a method to set the expectations number

Companion object to the Success class providing a method to set the expectations number

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Success.type
object Typecheck

This macro checks if some code can be parsed and typechecks ok

This macro checks if some code can be parsed and typechecks ok

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Typecheck.type
case class TypecheckErrors(errors: List[Error]) extends TypecheckResult

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
sealed trait TypecheckResult

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object TypecheckSuccess.type

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type