This method can be called directly from the console with the specs2.
This method can be called directly from the console with the specs2.run object:
> specs2.run(spec1, spec2) or > import specs2._ > run(spec1, spec2)
If you want to pass specific arguments you can pass:
> import specs2.args._ > specs2.run(spec1)(nocolor)
Or you can set specific default with an implicit value:
> import specs2.args._ > implicit val myargs = nocolor > specs2.run(spec1)
an instance of a given class, returning either the instance, or an exception
A system property 'debugCreateObject' can be set to override the printMessage and printStackTrace parameters so that the exception message and stacktrace are printed when the object can't be created
A system property 'debugCreateObject' can be set to override the printMessage and printStackTrace parameters so that the exception message and stacktrace are printed when the object can't be created
an instance of a given class and optionally print message and/or the stacktrace if the class can't be loaded.
an instance of a given class and optionally print message if the class can't be loaded
an instance of a given class
exit the system with a specific code:
exit the system with a specific code:
- 0 if all the specifications are successful - 1 if there are only failures - 100 if there is any error - 101 if one of them could not even be executed (this is represented by None)
exit the system for one executed specification (None means that the specification could not be executed)
exit the system for one executed specification (None means that the specification could not be executed)
this method can be overriden for testing
this method can be overriden for testing
flush the content if necessary
flush the content if necessary
print an object with no newline
print an object with no newline
print stacktraces
print stacktraces
print several objects according to a format string (see Console.
print several objects according to a format string (see Console.printf)
print an object with a newline
print an object with a newline
Try to create an instance of a given class by using whatever constructor is available and trying to instantiate the first parameter recursively if there is a parameter for that constructor.
Try to create an instance of a given class by using whatever constructor is available and trying to instantiate the first parameter recursively if there is a parameter for that constructor.
This is useful to instantiate nested classes which are referencing their outer class in their constructor
Try to create an instance of a given class by using whatever constructor is available and trying to instantiate the first parameter recursively if there is a parameter for that constructor.
Try to create an instance of a given class by using whatever constructor is available and trying to instantiate the first parameter recursively if there is a parameter for that constructor.
This is useful to instantiate nested classes which are referencing their outer class in their constructor
This class can be used to executed a Specification in the Console by specifying its name as the first argument on the command line
org.specs2.main.Arguments for other command line options
specs2.run