org.specs2

files

object files extends FilesRunner

This top-level object can be used to execute Specifications found in the source directory

Linear Supertypes
FilesRunner, SpecificationsFinder, ConsoleOutput, Classes, Output, FileSystem, FileWriter, FileReader, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. files
  2. FilesRunner
  3. SpecificationsFinder
  4. ConsoleOutput
  5. Classes
  6. Output
  7. FileSystem
  8. FileWriter
  9. FileReader
  10. AnyRef
  11. Any
Visibility
  1. Public
  2. All

Value Members

  1. def != (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  2. def != (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  3. def ## (): Int

    Attributes
    final
    Definition Classes
    AnyRef → Any
  4. def == (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  5. def == (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  6. def afterExecution (specs: Seq[SpecificationStructure])(implicit args: Arguments): Unit

    print a message after the execution based on the number of specifications

    print a message after the execution based on the number of specifications

    Attributes
    protected
    Definition Classes
    FilesRunner
  7. def append (path: String)(function: (Writer) ⇒ Unit): Unit

    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

    path of the file to write

    Definition Classes
    FileWriter
  8. def appendToFile (path: String, content: ⇒ String): Unit

    writes some content to a file.

    writes some content to a file.

    path

    path of the file to read

    content

    content of the file to write

    Definition Classes
    FileWriter
  9. def appendToXmlFile (path: String, content: ⇒ NodeSeq): Unit

    writes some xml content to a file.

    writes some xml content to a file.

    path

    path of the file to read

    content

    content of the file to write

    Definition Classes
    FileWriter
  10. def asInstanceOf [T0] : T0

    Attributes
    final
    Definition Classes
    Any
  11. def beforeExecution (implicit args: Arguments): Unit

    print a message before the execution

    print a message before the execution

    Attributes
    protected
    Definition Classes
    FilesRunner
  12. def canRead (path: String): Boolean

    returns

    true if the file can be read

    Definition Classes
    FileSystem
  13. def canWrite (path: String): Boolean

    returns

    true if the file can be written

    Definition Classes
    FileSystem
  14. def classNames (packageName: String, content: String, pattern: Pattern, suffix: String, verbose: Boolean = false): Seq[String]

    adds possible specification class names found in the file filePath
    The specification pattern is: "\\s*object\\s*(" + pattern + ")\\s*extends\\s*.*Spec.*\\s*\\{" This may be later extended to support other arbitrary patterns
    The specification pattern is: "\\s*object\\s*(" + pattern + ")\\s*extends\\s*.*Spec.*\\s*\\{" This may be later extended to support other arbitrary patterns

    adds possible specification class names found in the file filePath
    The specification pattern is: "\\s*object\\s*(" + pattern + ")\\s*extends\\s*.*Spec.*\\s*\\{" This may be later extended to support other arbitrary patterns

    content

    content of the file

    pattern

    a regular expression which is supposed to match an object name extending a Specification

    Definition Classes
    SpecificationsFinder
  15. def clone (): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  16. def copy (input: InputStream, output: OutputStream): Unit

    Copy an input stream to an output stream.

    Copy an input stream to an output stream.

    input

    input stream

    output

    output stream

    Definition Classes
    FileSystem
  17. def copyDir (src: String, dest: String): Unit

    copy the content of a directory to another.

    copy the content of a directory to another.

    dest

    destination directory path

    Definition Classes
    FileSystem
  18. def copyDir (url: URL, dest: String): Unit

    copy the content of a directory to another.

    copy the content of a directory to another.

    url

    url of the directory to copy

    dest

    destination directory path

    Definition Classes
    FileSystem
  19. def copyFile (path: String, dest: String): Unit

    Copy the content of a directory to another.

    Copy the content of a directory to another.

    path

    path of the file to copy

    dest

    destination directory path

    Definition Classes
    FileSystem
  20. def copySpecResourcesDir (src: String, outputDir: String): Unit

    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

    src

    name of the resource directory to copy

    outputDir

    output directory where to copy the files to

    Definition Classes
    FileSystem
  21. def create [T <: AnyRef] (className: String = "", classLoader: ClassLoader = ...)(implicit m: ClassManifest[T]): Either[Throwable, T]

    returns

    an instance of a given class, returning either the instance, or an exception

    Definition Classes
    Classes
  22. def createArguments (arguments: Array[String]): Arguments

    returns

    the Arguments object depending on the command-line options

    Attributes
    protected
    Definition Classes
    FilesRunner
  23. def createDir (path: String): Boolean

    creates a directory for a given path

    creates a directory for a given path

    Definition Classes
    FileSystem
  24. def createFile (path: String): AnyVal

    creates a file for a given path.

    creates a file for a given path. Create the parent directory if necessary.

    Definition Classes
    FileWriter
  25. def createObject [T <: AnyRef] (className: String, printMessage: Boolean, printStackTrace: Boolean)(implicit m: ClassManifest[T]): Option[T]

    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

    returns

    an instance of a given class and optionally print message and/or the stacktrace if the class can't be loaded.

    Definition Classes
    Classes
  26. def createObject [T <: AnyRef] (className: String, printMessage: Boolean)(implicit m: ClassManifest[T]): Option[T]

    returns

    an instance of a given class and optionally print message if the class can't be loaded

    Definition Classes
    Classes
  27. def createObject [T <: AnyRef] (className: String)(implicit m: ClassManifest[T]): Option[T]

    returns

    an instance of a given class

    Definition Classes
    Classes
  28. def createSpecification (className: String, printMessage: Boolean, printStackTrace: Boolean): Option[SpecificationStructure]

    returns

    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.

    Definition Classes
    SpecificationsFinder
  29. def createSpecification (className: String): Option[SpecificationStructure]

    returns

    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.

    Definition Classes
    SpecificationsFinder
  30. def delete (path: String): Boolean

    delete a file

    delete a file

    Definition Classes
    FileWriter
  31. def eq (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  32. def equals (arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  33. def execute (s: SpecificationStructure, r: Reporter)(implicit args: Arguments): Reporter

    report a specification

    report a specification

    Attributes
    protected
    Definition Classes
    FilesRunner
  34. def exists (path: String): Boolean

    returns

    true if the file exists

    Definition Classes
    FileWriter
  35. def filePaths (basePath: String = ".", path: String = "*", verbose: Boolean = false): Seq[String]

    path

    glob expression, for example: ./dir/**/.xml

    returns

    the list of paths represented by the "glob" definition path

    Definition Classes
    FileSystem
  36. def finalize (): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  37. def flush (): Unit

    flush the content if necessary

    flush the content if necessary

    Definition Classes
    ConsoleOutput → Output
  38. def getAbsolutePath (path: String): String

    returns

    the file absolute path

    Definition Classes
    FileSystem
  39. def getCanonicalPath (path: String): String

    returns

    the file canonical path

    Definition Classes
    FileSystem
  40. def getClass (): java.lang.Class[_]

    Attributes
    final
    Definition Classes
    AnyRef → Any
  41. def getName (path: String): String

    returns

    the file name

    Definition Classes
    FileSystem
  42. def getParent (path: String): String

    returns

    the file parent path

    Definition Classes
    FileSystem
  43. def getWriter (path: String, append: Boolean = false): Writer

    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

    returns

    a Writer object opened on the file designated by path

    Definition Classes
    FileWriter
  44. def globToPattern (glob: String): String

    returns

    the regular expression equivalent to a glob pattern (see the specs for Fragments)

    Definition Classes
    FileSystem
  45. def hashCode (): Int

    Definition Classes
    AnyRef → Any
  46. def inputStream (filePath: String): InputStream

    returns

    a FileInputStream for a given file path

    Definition Classes
    FileReader
  47. def isAbsolute (path: String): Boolean

    returns

    true if the file is absolute

    Definition Classes
    FileSystem
  48. def isDir (path: String): Boolean

    returns

    true if the File represented by this path is a directory

    Definition Classes
    FileSystem
  49. def isDirectory (path: String): Boolean

    returns

    true if the file is a directory

    Definition Classes
    FileSystem
  50. def isFile (path: String): Boolean

    returns

    true if the file is a file

    Definition Classes
    FileSystem
  51. def isHidden (path: String): Boolean

    returns

    true if the file is hidden

    Definition Classes
    FileSystem
  52. def isInstanceOf [T0] : Boolean

    Attributes
    final
    Definition Classes
    Any
  53. def listFiles (path: String): List[String]

    returns

    the files of that directory

    Definition Classes
    FileSystem
  54. def loadXhtmlFile (filePath: String): NodeSeq

    returns

    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

    Definition Classes
    FileReader
  55. def loadXmlFile (filePath: String): NodeSeq

    returns

    the xml content of a file, using the XML parser

    Definition Classes
    FileReader
  56. def main (arguments: Array[String]): Unit

    Definition Classes
    FilesRunner
  57. def mkdirs (path: String): Boolean

    creates a new directory

    creates a new directory

    Definition Classes
    FileWriter
  58. def ne (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  59. def notify (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  60. def notifyAll (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  61. def packageName (content: String): String

    returns

    the package declaration at the beginning of a file

    Definition Classes
    SpecificationsFinder
  62. def print (m: Any): Unit

    print an object with no newline

    print an object with no newline

    Definition Classes
    Output
  63. def printStackTrace (t: Throwable): Unit

    print stacktraces

    print stacktraces

    Definition Classes
    Output
  64. def printf (s: String, args: Any*): Unit

    print several objects according to a format string (see Console.

    print several objects according to a format string (see Console.printf)

    Definition Classes
    ConsoleOutput → Output
  65. def println (m: Any): Unit

    print an object with a newline

    print an object with a newline

    Definition Classes
    Output
  66. def readFile (path: String): String

    reads the content of a file

    reads the content of a file

    path

    the path of the file to read

    returns

    the content of the file at path

    Definition Classes
    FileReader
  67. def readLines (path: String): IndexedSeq[String]

    Definition Classes
    FileReader
  68. def removeDir (path: String): String

    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

    Definition Classes
    FileSystem
  69. def reporters (implicit arguments: Arguments): List[Reporter]

    returns

    a reporter depending on the provided arguments

    Attributes
    protected
    Definition Classes
    FilesRunner
  70. def specPattern (specType: String, pattern: String): String

    pattern to use to get specification names from file contents

    pattern to use to get specification names from file contents

    Definition Classes
    SpecificationsFinder
  71. def specificationClassNames (implicit args: Arguments): Seq[String]

    returns

    the specifications class names to execute

    Attributes
    protected
    Definition Classes
    FilesRunner
  72. def specificationNames (path: String = "**/*.scala", pattern: String = ".*Spec", basePath: String = FromSource.srcDir, verbose: Boolean = false): Seq[String]

    path

    a path to a directory containing scala files (it can be a glob: i.e. "dir/**/spec.scala")

    pattern

    a regular expression which is supposed to match an object name extending a Specification

    returns

    specification names by scanning files and trying to find specifications declarations

    Definition Classes
    SpecificationsFinder
  73. def specifications (implicit args: Arguments): Seq[SpecificationStructure]

    returns

    the specifications to execute

    Attributes
    protected
    Definition Classes
    FilesRunner
  74. def specifications (path: String = "**/*.scala", pattern: String = ".*Spec", filter: (String) ⇒ Boolean = (name: String) => true, basePath: String = FromSource.srcDir, verbose: Boolean = false): Seq[SpecificationStructure]

    path

    a path to a directory containing scala files (it can be a glob: i.e. "dir/**/spec.scala")

    pattern

    a regular expression which is supposed to match an object name extending a Specification

    filter

    a function to filter out unwanted specifications

    returns

    specifications created from specification names

    Definition Classes
    SpecificationsFinder
  75. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  76. def toString (): String

    Definition Classes
    AnyRef → Any
  77. def tryToCreateObject [T <: AnyRef] (className: String, printMessage: Boolean = true, printStackTrace: Boolean = true, loader: ClassLoader = ...)(implicit m: ClassManifest[T]): Option[T]

    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

    Definition Classes
    Classes
  78. def unjar (path: String, dirPath: String, regexFilter: String): Unit

    Unjar the jar (or zip file) specified by "path" to the "dest" directory.

    Unjar the jar (or zip file) specified by "path" to the "dest" directory. Filters files which shouldn't be extracted with a regular expression.

    path

    path of the jar file

    regexFilter

    regular expression filtering files which shouldn't be extracted

    Definition Classes
    FileSystem
  79. def unjar (path: String, dest: String): Unit

    Unjar the jar (or zip file) specified by "path" to the "dest" directory.

    Unjar the jar (or zip file) specified by "path" to the "dest" directory.

    path

    path of the jar file

    dest

    destination directory path

    Definition Classes
    FileSystem
  80. def wait (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  81. def wait (arg0: Long, arg1: Int): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  82. def wait (arg0: Long): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  83. def write (path: String)(function: (Writer) ⇒ Unit): Unit

    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

    path of the file to write

    Definition Classes
    FileWriter
  84. def writeFile (path: String, content: ⇒ String): Unit

    writes some content to a file.

    writes some content to a file.

    path

    path of the file to read

    content

    content of the file to write

    Definition Classes
    FileWriter
  85. def writeXmlFile (path: String, content: ⇒ NodeSeq): Unit

    writes some xml content to a file.

    writes some xml content to a file.

    path

    path of the file to read

    content

    content of the file to write

    Definition Classes
    FileWriter

Inherited from FilesRunner

Inherited from SpecificationsFinder

Inherited from ConsoleOutput

Inherited from Classes

Inherited from Output

Inherited from FileSystem

Inherited from FileWriter

Inherited from FileReader

Inherited from AnyRef

Inherited from Any