org.specs2

control

package control

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. control
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. type Action[A] = ActionT[IO, Logs, Logger, A]

    Action type, using a logger as a reader and no writer

  2. case class ActionException(warnings: Vector[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

  3. case class ActionT[F[_], W, R, A](runT: (R) ⇒ StatusT[[a]WriterT[F, W, a], A]) extends Product with Serializable

    A data type for holding computations that can fail with exceptions.

    A data type for holding computations that can fail with exceptions. This is effectively a ReaderT > ErrorT > WriterT > F stack, with a specialized error type. This particular specialization handles string/exception based failures and should be used to wrap up unsafe apis (i.e. java code).

    This specialization exists for a number of reasons:

    • Basically because you can't use the stack directly via a type alias without incurring the wrath of scalac and the inference warlords.
    • The formulation lets us plug in a few things together to handle IO and other values of F, whilst keeping some level of sanity.

    Credits to @markhibberd

  4. trait ActionTLowPriority extends AnyRef

  5. trait ActionTSupport[F[_], W, R] extends AnyRef

  6. 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

  7. 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

  8. trait ExecutionOrigin extends Stacktraces

    This trait is used primarily to change the junit behavior depending on the execution environment

  9. trait Functions extends AnyRef

    This trait provides utility methods for functions

  10. 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

  11. 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
    • ...
  12. 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

  13. case class Ko[A](error: scalaz.\&/.These[String, Throwable]) extends Status[A] with Product with Serializable

  14. 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

  15. class LazyParameter[+T] extends AnyRef

    class holding a value to be evaluated lazily

  16. 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.

  17. 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

  18. type Logger = (String) ⇒ IO[Unit]

    Actions logging

  19. type Logs = Vector[String]

  20. trait LowPriorityStatusT extends AnyRef

  21. 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

  22. trait NoDebug extends Debug

    Use this trait to disable the pp method on objects

  23. trait NoLanguageFeatures extends LanguageFeatures

  24. trait NoNumberOfTimes extends NumberOfTimes

  25. trait NumberOfTimes extends AnyRef

    Syntactic sugar to execute an action a given number of times

  26. case class Ok[A](value: A) extends Status[A] with Product with Serializable

  27. trait Properties extends AnyRef

  28. 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

  29. trait SomeTimeout extends AnyRef

  30. trait StackTraceFilter extends AnyRef

    This trait filters an Exception stacktrace

  31. trait Stacktraces extends AnyRef

    Utility methods to determine the origin of the execution of the current code

  32. sealed trait Status[+A] extends AnyRef

    A data type for holding statuses.

    A data type for holding statuses. This is effectively just an Either with a specialized left. This particular specialization handles string/exception based failures and should be used to wrap up unsafe apis (i.e. java code).

    This specialization exists for a number of reasons:

    • scala.
    • having a single type param helps inference in a non-trivial way (this is essential to it later being used in a monad transformer).
    • useful methods for manipulating error messages.
    • better pattern matching support.
    • and again, scala.

    Credits to @markhibberd

  33. case class StatusT[F[_], A](run: F[Status[A]]) extends Product with Serializable

    Transformer version of Status

    Transformer version of Status

    Credits to @markhibberd

  34. trait Throwablex extends AnyRef

    This trait adds some utility methods to Throwable objects.

  35. case class Times(n: Int) extends Product with Serializable

  36. case class TraceLocation(path: String, fileName: String, className: String, methodName: String, lineNumber: Int) extends Product with Serializable

  37. implicit class ioActionToOption[T] extends AnyRef

    execute an action with no logging and return an option

  38. implicit class ioActionToProcess[T] extends AnyRef

    An Action[T] can be converted to a Task[T] then to a Process[T] returning just one element

  39. implicit class ioActionToTask[T] extends AnyRef

    An Action[T] can be converted to a Task[T]

  40. implicit class taskToAction[T] extends AnyRef

    A Task[T] (the result of running a Process[Task, T] for example) can be converted to an Action[T]

Value Members

  1. object ActionT extends ActionTLowPriority with Serializable

  2. object Actions extends ActionTSupport[IO, Logs, Logger]

  3. object Debug extends Debug

  4. object DefaultStackTraceFilter extends IncludeExcludeStackTraceFilter with ExecutionOrigin

    default filter for specs2 runs

  5. object Exceptions extends Exceptions

  6. object Executable

    Execute external commands

  7. object ExecutionOrigin extends ExecutionOrigin

  8. object Functions extends Functions

  9. object FutureInstances

  10. object ImplicitParameters extends ImplicitParameters

  11. 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

  12. object LazyParameters extends LazyParameters

  13. implicit def LogsMonoid: Monoid[Logs]

  14. object NoStackTraceFilter extends StackTraceFilter

    This filter doesn't do anything

  15. object NumberOfTimes extends NumberOfTimes

  16. object Properties extends Properties

  17. object Property extends Serializable

    Companion object to create properties with possibly no initial value

  18. object SomeTimeout extends SomeTimeout

  19. object StackTraceFilter

  20. object Stacktraces extends Stacktraces

  21. object Status

  22. object StatusT extends LowPriorityStatusT with Serializable

  23. object Throwables

  24. object Throwablex extends Throwablex

  25. object TraceLocation extends Serializable

  26. lazy val consoleLogging: (String) ⇒ IO[Unit]

  27. implicit def ioActionResultAsResult[T](implicit arg0: AsResult[T]): AsResult[Action[T]]

    This implicit allows an IOAction[result] to be used inside an example.

    This implicit allows an IOAction[result] to be used inside an example.

    For example to read a database.

  28. 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) }

  29. def log[R](r: R, verbose: Boolean): Action[Unit]

    log a value, using the logger coming from the Reader environment, only if verbose is true

  30. def log[R](r: R): Action[Unit]

    log a value, using the logger coming from the Reader environment

  31. def logThrowable(t: Throwable): Action[Unit]

  32. def logThrowable(t: Throwable, verbose: Boolean): Action[Unit]

    log a Throwable with its stacktrace and cause, using the logger coming from the Reader environment

  33. lazy val noLogging: (String) ⇒ IO[Unit]

  34. def warn(message: String): Action[Unit]

    warn the user about something that is probably wrong on his side, this is not a specs2 bug

  35. def warnAndFail[A](message: String, failureMessage: String): Action[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

Inherited from AnyRef

Inherited from Any

Ungrouped