Action type, using a logger as a reader and no writer
This exception class is used when an Action is transformed to a Task to avoid losing information
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:
Credits to @markhibberd
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
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.
org.specs2.control.ExceptionsSpec for examples
This trait is used primarily to change the junit behavior depending on the execution environment
This trait provides utility methods for functions
This trait describes something which has a stackTrace with:
This trait describes something which has a stackTrace with:
This is used to provide a common interface to execute.Failure and execute.Error
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:
Implementation of the StackTraceFilter trait with a list of include/exclude patterns
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 holding a value to be evaluated lazily
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.
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
org.specs2.specification.process.RandomSequentialExecution for an example of use
Actions logging
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
Use this trait to disable the pp
method on objects
Syntactic sugar to execute an action a given number of times
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
This trait filters an Exception stacktrace
Utility methods to determine the origin of the execution of the current code
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:
Credits to @markhibberd
Transformer version of Status
Transformer version of Status
Credits to @markhibberd
This trait adds some utility methods to Throwable
objects.
execute an action with no logging and return an option
An Action[T] can be converted to a Task[T] then to a Process[T] returning just one element
An Action[T] can be converted to a Task[T]
A Task[T] (the result of running a Process[Task, T] for example) can be converted to an Action[T]
default filter for specs2 runs
Execute external commands
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
This filter doesn't do anything
Companion object to create properties with possibly no initial value
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.
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) }
log a value, using the logger coming from the Reader environment, only if verbose is true
log a value, using the logger coming from the Reader environment
log a Throwable with its stacktrace and cause, using the logger coming from the Reader environment
warn the user about something that is probably wrong on his side, this is not a specs2 bug
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