package control
- Alphabetic
- By Inheritance
- control
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- type Action[A] = Eff[ActionStack, A]
-
case class
ActionException
(warnings: List[String], message: Option[String], throwable: Option[Throwable]) extends Exception with Product with Serializable
This exception class is used when an Action is transformed to a Task to avoid losing information
- type ActionStack = FxAppend[Fx2[TimedFuture, control.eff.ErrorEffect.ErrorOrOk], Fx3[Console, Warnings, Safe]]
- type AsyncFold[A, B] = Fold[ActionStack, A, B]
- type AsyncSink[A] = Fold[ActionStack, A, Unit]
- type AsyncStream[A] = Producer[ActionStack, A]
- type AsyncTransducer[A, B] = (Producer[ActionStack, A]) ⇒ Producer[ActionStack, B]
-
trait
Debug
extends ImplicitParameters
This trait provides simple a way to print out any object to the console:
This trait provides simple a way to print out any object to the console:
"this string".pp must_== "this string"
will print 'this string' and pass it to the rest of the expectation
-
trait
Exceptions
extends AnyRef
This trait provides methods to catch exceptions and transform them into values which can be passed to further computations.
This trait provides methods to catch exceptions and transform them into values which can be passed to further computations.
It uses the facilities found in the scala.util.control.Exception object while providing a more concise api on some use cases.
- See also
org.specs2.control.ExceptionsSpec for examples
-
trait
ExecutionOrigin
extends Stacktraces
This trait is used primarily to change the junit behavior depending on the execution environment
-
trait
Functions
extends AnyRef
This trait provides utility methods for functions
-
trait
HasStackTrace
extends AnyRef
This trait describes something which has a stackTrace with:
This trait describes something which has a stackTrace with:
- a list of stacktrace element
This is used to provide a common interface to execute.Failure and execute.Error
-
trait
ImplicitParameters
extends AnyRef
This trait is used to abuse method overloading and allow some of the methods in specs2 DSL to be applicable to various parameters.
This trait is used to abuse method overloading and allow some of the methods in specs2 DSL to be applicable to various parameters.
For example in a mutable specification, the >> method is overloaded for lots of different arguments:
- result
- function of the Environment
- function of the Command line
- ...
-
case class
IncludeExcludeStackTraceFilter
(include: Seq[String], exclude: Seq[String]) extends StackTraceFilter with Product with Serializable
Implementation of the StackTraceFilter trait with a list of include/exclude patterns
-
trait
LanguageFeatures
extends AnyRef
implicits and postfix ops are automatically mixed in specs2 specifications for convenience.
implicits and postfix ops are automatically mixed in specs2 specifications for convenience. If you *really* don't want that you can override this behaviour by using the NoLanguageFeatures trait
-
class
LazyParameter
[+T] extends AnyRef
class holding a value to be evaluated lazily
-
trait
LazyParameters
extends AnyRef
This trait can be used to allow some function to be called with varargs, with values being evaluated lazily:
This trait can be used to allow some function to be called with varargs, with values being evaluated lazily:
def method[T](values: LazyParameter[T]*) = { values.toStream // use the toStream method to consume the values lazily } // usage method(exp1, exp2, exp3)
Note that the values are really evaluated once, unlike a by-name parameter.
-
case class
LazyValue
[T](t: () ⇒ T) extends Product with Serializable
This class simply encapsulates a lazy value which will be only evaluated once
This class simply encapsulates a lazy value which will be only evaluated once
- See also
org.specs2.specification.process.RandomSequentialExecution for an example of use
-
type
Logger = (String) ⇒ Unit
Actions logging
-
case class
NamedThreadFactory
(namePrefix: String, group: ThreadGroup = Thread.currentThread.getThreadGroup, priority: Int = Thread.currentThread.getPriority) extends ThreadFactory with Product with Serializable
This factory creates named threads which can be prefixed by "specs2" to track the threads used by specs2 for the specification execution
This factory creates named threads which can be prefixed by "specs2" to track the threads used by specs2 for the specification execution
Contributed by @jedws
-
trait
NoDebug
extends Debug
Use this trait to disable the
ppmethod on objects - trait NoLanguageFeatures extends LanguageFeatures
- trait NoNumberOfTimes extends NumberOfTimes
-
trait
NumberOfTimes
extends AnyRef
Syntactic sugar to execute an action a given number of times
- type Operation[A] = Eff[OperationStack, A]
- type OperationStack = FxAppend[Fx1[control.eff.ErrorEffect.ErrorOrOk], Fx3[Console, Warnings, Safe]]
- trait Properties extends AnyRef
-
case class
Property
[T](value: () ⇒ Option[T], evaluated: Boolean = false, evaluatedValue: Option[T] = None) extends Product with Serializable
This class represents values which are evaluated lazily and which may even be missing.
This class represents values which are evaluated lazily and which may even be missing.
It has Option-like function and can be also converted to an Either object
-
trait
StackTraceFilter
extends AnyRef
This trait filters an Exception stacktrace
-
trait
Stacktraces
extends AnyRef
Utility methods to determine the origin of the execution of the current code
- type StreamStack = Fx2[TimedFuture, Safe]
-
trait
Throwablex
extends AnyRef
This trait adds some utility methods to
Throwableobjects. - case class Times (n: Int) extends Product with Serializable
- case class TraceLocation (path: String, fileName: String, className: String, methodName: String, lineNumber: Int) extends Product with Serializable
-
case class
UserException
(message: String, throwable: Throwable) extends Exception with Product with Serializable
This exception class is used to notify the user of instantiation errors
- implicit class actionOps [T] extends AnyRef
- implicit class ioOperationToOption [T] extends AnyRef
- implicit class operationOps [T] extends AnyRef
Value Members
-
implicit
def
actionAsResult[T](implicit arg0: AsResult[T]): AsResult[Action[T]]
This implicit allows an Action[result] to be used inside an example.
This implicit allows an Action[result] to be used inside an example.
For example to read a database.
- def attemptAction[A](action: Action[A], printer: (String) ⇒ Unit = s => ()): \/[Throwable, A]
- def attemptExecuteAction[A](action: Action[A], printer: (String) ⇒ Unit = s => ()): \/[Throwable, (\/[control.eff.ErrorEffect.Error, A], List[String])]
- def attemptExecuteOperation[A](operation: Operation[A], printer: (String) ⇒ Unit = s => ()): \/[Throwable, (\/[control.eff.ErrorEffect.Error, A], List[String])]
- lazy val consoleLogging: (String) ⇒ Unit
- def emitAsync[A](as: A*): AsyncStream[A]
- def emitAsyncDelayed[A](a: A): AsyncStream[A]
- def executeAction[A](action: Action[A], printer: (String) ⇒ Unit = s => ()): (\/[control.eff.ErrorEffect.Error, A], List[String])
- def executeOperation[A](operation: Operation[A], printer: (String) ⇒ Unit = s => ()): (\/[control.eff.ErrorEffect.Error, A], List[String])
- lazy val executorServices: ExecutorServices
-
implicit
def
ioResultAsResult[T](implicit arg0: AsResult[T]): AsResult[IO[T]]
This implicit allows any IO[Result] to be used inside an example:
This implicit allows any IO[Result] to be used inside an example:
"this should work" in { IO(success) }
- lazy val noLogging: (String) ⇒ Unit
-
implicit
def
operationAsResult[T](implicit arg0: AsResult[T]): AsResult[Operation[T]]
This implicit allows an Operation[result] to be used inside an example.
- implicit def operationToAction[A](operation: Operation[A]): Action[A]
- def runAction[A](action: Action[A], printer: (String) ⇒ Unit = s => ()): \/[control.eff.ErrorEffect.Error, A]
- def runOperation[A](operation: Operation[A], printer: (String) ⇒ Unit = s => ()): \/[control.eff.ErrorEffect.Error, A]
-
def
warnAndFail[R, A](message: String, failureMessage: String)(implicit m1: <=[Warnings, R], m2: <=[control.eff.ErrorEffect.ErrorOrOk, R]): Eff[R, A]
warn the user about something that is probably wrong on his side, this is not a specs2 bug, then fail to stop all further computations
- object Actions
- object Debug extends Debug
-
object
DefaultStackTraceFilter
extends IncludeExcludeStackTraceFilter with ExecutionOrigin
default filter for specs2 runs
- object Exceptions extends Exceptions
-
object
Executable
Execute external commands
- object ExecutionOrigin extends ExecutionOrigin
- object Functions extends Functions
- object FutureInstances
- object ImplicitParameters extends ImplicitParameters
-
object
IncludeExcludeStackTraceFilter
extends Serializable
Factory object to build a stack trace filter from include/exclude expressions:
Factory object to build a stack trace filter from include/exclude expressions:
.*specs2 ==> include .*specs2 traces .*specs2/scala.* ==> include .*specs2 traces, exclude scala.* traces .*specs2,scala/scalaz,eclipse ==> include .*specs2,scala traces, exclude scalaz and eclipse traces
- object LazyParameters extends LazyParameters
-
object
NoStackTraceFilter
extends StackTraceFilter
This filter doesn't do anything
- object NumberOfTimes extends NumberOfTimes
- object Operations
- object Properties extends Properties
-
object
Property
extends Serializable
Companion object to create properties with possibly no initial value
- object StackTraceFilter
- object Stacktraces extends Stacktraces
- object Throwables
- object Throwablex extends Throwablex
- object TraceLocation extends Serializable