package execute
- Alphabetic
- Public
- All
Type Members
-
class
AnyValueAsResult[T] extends AsResult[T]
Type class to transform any value to a Result
-
trait
AsResult[T] extends AnyRef
Typeclass trait for anything that can be transformed to a Result
-
case class
DecoratedResult[+T](decorator: T, result: Result) extends Result with Product with Serializable
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
-
case class
DecoratedResultException(result: DecoratedResult[_]) extends Exception with ExecuteException with Product with Serializable
this class allows to throw a result that's decorated with additional information in an Exception
-
sealed
trait
Details extends AnyRef
Trait to model detailed information for failures so that smart differences can be computed
-
case class
Error(m: String, t: Throwable) extends Result with ResultStackTrace with Product with Serializable
This class represents an exception occurring during an execution.
-
case class
ErrorException(f: Error) extends Exception with ExecuteException with Product with Serializable
this class allows to throw an Error result in an Exception
-
trait
EventuallyResults extends AnyRef
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)
-
trait
Executable extends AnyRef
Trait for anything that can be executed to return a Result
- trait ExecuteException extends Exception
-
case class
Failure(m: String = "", e: String = "", stackTrace: List[StackTraceElement] = ..., details: Details = NoDetails) extends Result with ResultStackTrace with Product with Serializable
This class represents the failure of an execution.
This class represents the failure of an execution. It has a message and a stacktrace
- case class FailureDetails(actual: String, expected: String) extends Details with Product with Serializable
-
case class
FailureException(f: Failure) extends Exception with ExecuteException with Product with Serializable
this class allows to throw a failure result in an Exception
- case class FailureMapDetails(actual: Map[Any, Any], expected: Map[Any, Any]) extends Details with Product with Serializable
- case class FailureSeqDetails(actual: Seq[Any], expected: Seq[Any]) extends Details with Product with Serializable
- case class FailureSetDetails(actual: Set[Any], expected: Set[Any]) extends Details with Product with Serializable
-
class
Function0Result extends AnyRef
This class is used to delay the execution of a result
-
trait
Isolable extends AnyRef
This trait models elements which can be executed in a brand new context with new local variables It is used to execute examples in a new specification when needed
- case class MyClass(list: List[_]) extends Product with Serializable
- case class ParseError(message: String) extends TypecheckResult with Product with Serializable
-
case class
Pending(m: String = "") extends Result with Product with Serializable
Pending result
Pending result
- See also
Result for description
-
case class
PendingException(f: Pending) extends Exception with ExecuteException with Product with Serializable
this class allows to throw a pending result in an Exception
-
sealed abstract
class
Result extends AnyRef
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).
-
trait
ResultExecution extends AnyRef
This trait executes a Result and returns an appropriate value when a specs2 exception is thrown
-
trait
ResultImplicits extends AnyRef
This trait adds some implicits to easily fold sequences of results
-
trait
ResultLike extends AnyRef
This trait can be used for anything that can be converted to a Result.
This trait can be used for anything that can be converted to a Result.
It is used by the MatchResult class so it can be executed as any other kind of Result by the
ResultExecution
class without introducing a dependency between theexecute
and thematcher
package -
trait
ResultLogicalCombinators extends Results
This trait provides logical combinators to Results: and, or, not
This trait provides logical combinators to Results: and, or, not
A Result expression can throw an exception which will be changed into a failure or an error before being used with and/or/not
-
trait
ResultStackTrace extends HasStackTrace
The stacktrace for a Result
- trait Results extends AnyRef
-
case class
ScissorsCutter(cutMarker: String = scissorsMarker, cutMarkerFormat: String = scissorsMarkerFormat) extends (String) ⇒ String with Product with Serializable
Implementation of a function to cut pieces of code by using some comments as markers
-
case class
SkipException(f: Skipped) extends Exception with ExecuteException with Product with Serializable
this class allows to throw a skipped result in an Exception
-
case class
Skipped(m: String = "", e: String = "") extends Result with Product with Serializable
Skipped result
Skipped result
- See also
Result for description
-
case class
Snippet[T](code: () ⇒ T, codeExpression: Option[String] = None, params: SnippetParams[T] = SnippetParams[T]()) extends Product with Serializable
Captured snippet of code with: a value of type T, a string representing the expression, captured by a macro, some evaluation and display parameters
-
case class
SnippetParams[T](trimExpression: (String) ⇒ String = trimApproximatedSnippet, cutter: (String) ⇒ String = ScissorsCutter(), asCode: (String, String) ⇒ String = markdownCode(offset = 0), prompt: (String) ⇒ String = greaterThanPrompt, evalCode: Boolean = false, verify: Option[(T) ⇒ Result] = None) extends Product with Serializable
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
-
trait
Snippets extends AnyRef
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. -
trait
StandardResults extends AnyRef
This trait provides standard results which can be used in Fragments bodies
-
case class
Success(m: String = "", exp: String = "") extends Result with Product with Serializable
This class represents the success of an execution
- case class TypecheckError(message: String) extends TypecheckResult with Product with Serializable
- case class TypecheckParams(_deferMacros: Option[Boolean] = None, _deferImplicits: Option[Boolean] = None, _deferParsing: Option[Boolean] = None) extends Product with Serializable
- sealed trait TypecheckResult extends AnyRef
-
case class
Typechecked(code: String, result: TypecheckResult) extends Product with Serializable
result of the typechecking of some code
- case class UnexpectedTypecheckError(message: String) extends TypecheckResult with Product with Serializable
Value Members
- object AsResult
-
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
- object CanTypecheckLiteralsOnly extends TypecheckResult
-
object
Error extends Product with Serializable
This object allows to create an Error from an exception
- object EventuallyResults extends EventuallyResults
- object FromExpectationError extends Details with Product with Serializable
- object FromJUnitAssertionError extends Details with Product with Serializable
- object FromNotImplementedError extends Details with Product with Serializable
- object Function0Result
- object NoDetails extends Details with Product with Serializable
- object Result
- object ResultExecution extends ResultExecution
- object ResultImplicits extends ResultImplicits
- object ResultLogicalCombinators extends ResultLogicalCombinators
- object Results extends Results
- object Snippet extends Serializable
- object Snippets extends Snippets
- object StandardResults extends StandardResults
-
object
Success extends Serializable
Companion object to the Success class providing a method to set the expectations number
-
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
Credits:
- Stefan Zeiger (@StefanZeiger) for the typecheck method
- Jean-Remi Desjardins (@jrdesjardins) for the tc interpolator
- object TypecheckSuccess extends TypecheckResult
- object Typechecked extends Serializable