print a message after the execution based on the number of specifications
print a message after the execution based on the number of specifications
append some content to a file and take care of closing the file.
append some content to a file and take care of closing the file.
Usage:
write("./dir/hello.txt") { out => out.write("content") }
path of the file to write
writes some content to a file.
writes some content to a file.
path of the file to read
content of the file to write
writes some xml content to a file.
writes some xml content to a file.
path of the file to read
content of the file to write
print a message before the execution
print a message before the execution
true if the file can be read
true if the file can be written
extract the class names corresponding to a pattern found in a content
extract the class names corresponding to a pattern found in a content
the base package for the class names
content of a source file
a regular expression for a class name
Copy an input stream to an output stream.
Copy an input stream to an output stream.
input stream
output stream
copy the content of a directory to another.
copy the content of a directory to another.
destination directory path
copy a file to a destination directory
copy a file to a destination directory
path of the file to copy
destination directory path
Copy specs resources found either in the specs jar or in the classpath directories to an output directory
Copy specs resources found either in the specs jar or in the classpath directories to an output directory
path of the base package (must not be empty!)
name of the resource directory to copy (relative to the base package)
output directory where to copy the files to
an instance of a given class, returning either the instance, or an exception
the Arguments object depending on the command-line options
creates a directory for a given path
creates a directory for a given path
creates a file for a given path.
creates a file for a given path. Create the parent directory if necessary.
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
a SpecificationStructure
object from a className if that class is a SpecificationStructure
class.
Tries to load the class name and cast it to a specification
None in case of an exception.
a SpecificationStructure
object from a className if that class is a SpecificationStructure
class.
Tries to load the class name and cast it to a specification
None in case of an exception.
delete a file
delete a file
true if the file exists
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
glob expression, for example: ./dir/**/.xml
the list of paths represented by the "glob" definition path
flush the content if necessary
flush the content if necessary
the path of a File relative to a base file
the file absolute path
the file canonical path
the file name
the file parent path
The getWriter function can be overriden to provide a mock writer writing to the console for example
The getWriter function can be overriden to provide a mock writer writing to the console for example
a Writer object opened on the file designated by path
the regular expression equivalent to a glob pattern (see the specs for Fragments)
a FileInputStream for a given file path
true if the file is absolute
true if the File represented by this path is a directory
true if the file is a directory
true if the file is a file
true if the file is hidden
the files of that directory
the xml content of a file using the Xhtml parser
if the file contains several nodes, it wraps them up in a single artificial node
the xml content of a file, using the XML parser
the MD5 hash of a file
creates a new directory
creates a new directory
the package name corresponding to the package declarations at the beginning of a file
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
the bytes of a file
reads the content of a file
reads the content of a file
the path of the file to read
the content of the file at path
the lines of a file
deletes the directory and all directory content at the specified path and return the parent path of that directory
deletes the directory and all directory content at the specified path and return the parent path of that directory
true if 2 paths are the same according to their canonical representation
pattern to use to get specification names from file contents
pattern to use to get specification names from file contents
the specifications class names to execute
a path to a directory containing scala files (it can be a glob: i.e. "dir/**/spec.scala")
a regular expression which is supposed to match an object name extending a Specification
specification names by scanning files and trying to find specifications declarations
the specifications to execute
a path to a directory containing scala files (it can be a glob: i.e. "dir/**/spec.scala")
a regular expression which is supposed to match an object name extending a Specification
a function to filter out unwanted specifications
specifications created from specification names
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
writes some content to a file and take care of closing the file.
writes some content to a file and take care of closing the file.
Usage:
write("./dir/hello.txt") { out => out.write("content") }
path of the file to write
writes some content to a file.
writes some content to a file.
path of the file to read
content of the file to write
writes some xml content to a file.
writes some xml content to a file.
path of the file to read
content of the file to write
This trait finds specifications in the source directory, instantiate them as one big specification and report them using the ConsoleReporter or the HtmlReporter depending on the presence of the html flag
org.specs2.main.Arguments for the regular expression defining the specification names to extract and other options
org.specs2.io.FromSource for the definition of the source directory