org.specs2.matcher

FileMatchers

trait FileMatchers extends FileBaseMatchers with FileBeHaveMatchers

The FileMatchers trait provides matchers which are applicable to files

Linear Supertypes
FileBeHaveMatchers, FileBaseMatchers, PathMatchers, PathBeHaveMatchers, PathBaseMatchers, FileSystem, FileWriter, FileReader, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. FileMatchers
  2. FileBeHaveMatchers
  3. FileBaseMatchers
  4. PathMatchers
  5. PathBeHaveMatchers
  6. PathBaseMatchers
  7. FileSystem
  8. FileWriter
  9. FileReader
  10. AnyRef
  11. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. class FileResultMatcher[T <: AnyRef { def getPath(): String }] extends AnyRef

    Definition Classes
    FileBeHaveMatchers
  2. class PathResultMatcher extends AnyRef

    Definition Classes
    PathBeHaveMatchers

Value Members

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

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

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

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

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

    Definition Classes
    Any
  6. def aDirectory[T <: AnyRef { def getPath(): String }]: Matcher[AnyRef { def getPath(): String }]

    Definition Classes
    FileBeHaveMatchers
  7. def aDirectoryPath: PathMatcher

    Definition Classes
    PathBeHaveMatchers
  8. def aFile[T <: AnyRef { def getPath(): String }]: Matcher[AnyRef { def getPath(): String }]

    Definition Classes
    FileBeHaveMatchers
  9. def aFilePath: PathMatcher

    Definition Classes
    PathBeHaveMatchers
  10. def aHiddenPath: PathMatcher

    Definition Classes
    PathBeHaveMatchers
  11. def aReadablePath: PathMatcher

    Definition Classes
    PathBeHaveMatchers
  12. def aWritablePath: PathMatcher

    Definition Classes
    PathBeHaveMatchers
  13. def absolute[T <: AnyRef { def getPath(): String }]: Matcher[AnyRef { def getPath(): String }]

    Definition Classes
    FileBeHaveMatchers
  14. def absolutePath[T <: AnyRef { def getPath(): String }](path: String): Matcher[AnyRef { def getPath(): String }]

    Definition Classes
    FileBeHaveMatchers
  15. def anAbsolutePath: PathMatcher

    Definition Classes
    PathBeHaveMatchers
  16. def anExistingPath: PathMatcher

    Definition Classes
    PathBeHaveMatchers
  17. 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
  18. 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
  19. 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
  20. def asAbsolutePath(name: String): PathMatcher

    Definition Classes
    PathBeHaveMatchers
  21. def asCanonicalPath(name: String): PathMatcher

    Definition Classes
    PathBeHaveMatchers
  22. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  23. def beADirectory[T <: AnyRef { def getPath(): String }]: Matcher[T]

    matches if file.

    matches if file.isDirectory

    Definition Classes
    FileBaseMatchers
  24. def beADirectoryPath: PathMatcher

    matches if new File(path).

    matches if new File(path).isDirectory

    Definition Classes
    PathBaseMatchers
  25. def beAFile[T <: AnyRef { def getPath(): String }]: Matcher[T]

    matches if file.

    matches if file.isFile

    Definition Classes
    FileBaseMatchers
  26. def beAFilePath: PathMatcher

    matches if new File(path).

    matches if new File(path).isFile

    Definition Classes
    PathBaseMatchers
  27. def beAHiddenPath: PathMatcher

    matches if new File(path).

    matches if new File(path).isHidden

    Definition Classes
    PathBaseMatchers
  28. def beAReadablePath: PathMatcher

    matches if new File(path).

    matches if new File(path).canRead

    Definition Classes
    PathBaseMatchers
  29. def beAWritablePath: PathMatcher

    matches if new File(path).

    matches if new File(path).canWrite

    Definition Classes
    PathBaseMatchers
  30. def beAbsolute[T <: AnyRef { def getPath(): String }]: Matcher[T]

    matches if file.

    matches if file.isAbsolute

    Definition Classes
    FileBaseMatchers
  31. def beAnAbsolutePath: PathMatcher

    matches if new File(path).

    matches if new File(path).isAbsolute

    Definition Classes
    PathBaseMatchers
  32. def beAnExistingPath: PathMatcher

    matches if new File(path).

    matches if new File(path).exists

    Definition Classes
    PathBaseMatchers
  33. def beEqualToIgnoringSep(other: String): PathMatcher

    matches if 2 paths are the same regardless of their separators

    matches if 2 paths are the same regardless of their separators

    Definition Classes
    PathBaseMatchers
  34. def beHidden[T <: AnyRef { def getPath(): String }]: Matcher[T]

    matches if file.

    matches if file.isHidden

    Definition Classes
    FileBaseMatchers
  35. def beReadable[T <: AnyRef { def getPath(): String }]: Matcher[T]

    matches if file.

    matches if file.canRead

    Definition Classes
    FileBaseMatchers
  36. def beWritable[T <: AnyRef { def getPath(): String }]: Matcher[T]

    matches if file.

    matches if file.canWrite

    Definition Classes
    FileBaseMatchers
  37. def canRead(path: String): Boolean

    returns

    true if the file can be read

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

    returns

    true if the file can be written

    Definition Classes
    FileSystem
  39. def canonicalPath[T <: AnyRef { def getPath(): String }](path: String): Matcher[AnyRef { def getPath(): String }]

    Definition Classes
    FileBeHaveMatchers
  40. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  41. 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
  42. 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
  43. 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
  44. 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
  45. 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
  46. def createDir(path: String): Boolean

    creates a directory for a given path

    creates a directory for a given path

    Definition Classes
    FileSystem
  47. 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
  48. def delete(path: String): Boolean

    delete a file

    delete a file

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

    Definition Classes
    AnyRef
  50. def equalToIgnoringSep(other: String): PathMatcher

    Definition Classes
    PathBeHaveMatchers
  51. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  52. def exist[T <: AnyRef { def getPath(): String }]: Matcher[T]

    matches if file.

    matches if file.exists

    Definition Classes
    FileBaseMatchers
  53. def exists(path: String): Boolean

    returns

    true if the file exists

    Definition Classes
    FileWriter
  54. 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
  55. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  56. def getAbsolutePath(path: String): String

    returns

    the file absolute path

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

    returns

    the file canonical path

    Definition Classes
    FileSystem
  58. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  59. def getName(path: String): String

    returns

    the file name

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

    returns

    the file parent path

    Definition Classes
    FileSystem
  61. 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
  62. def globToPattern(glob: String): String

    returns

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

    Definition Classes
    FileSystem
  63. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  64. def haveAbsolutePath[T <: AnyRef { def getPath(): String }](path: String): Matcher[T]

    matches if file.

    matches if file.getAbsolutePath == path

    Definition Classes
    FileBaseMatchers
  65. def haveAsAbsolutePath(path: String): PathMatcher

    matches if new File(path).

    matches if new File(path).getAbsolutePath == absolutePath

    Definition Classes
    PathBaseMatchers
  66. def haveAsCanonicalPath(path: String): PathMatcher

    matches if new File(path).

    matches if new File(path).getCanonicalPath == canonicalPath

    Definition Classes
    PathBaseMatchers
  67. def haveCanonicalPath[T <: AnyRef { def getPath(): String }](path: String): Matcher[T]

    matches if file.

    matches if file.getCanonicalPath == path

    Definition Classes
    FileBaseMatchers
  68. def haveList[T <: AnyRef { def getPath(): String }](list: String): Matcher[T]

    matches if file.

    matches if file.list == list

    Definition Classes
    FileBaseMatchers
  69. def haveName[T <: AnyRef { def getPath(): String }](name: String): Matcher[T]

    matches if file.

    matches if file.getName == name

    Definition Classes
    FileBaseMatchers
  70. def haveParent[T <: AnyRef { def getPath(): String }](path: String): Matcher[T]

    matches if file.

    matches if file.getParent == path

    Definition Classes
    FileBaseMatchers
  71. def haveParentPath(parent: String): PathMatcher

    matches if new File(path).

    matches if new File(path).getParent == parent

    Definition Classes
    PathBaseMatchers
  72. def havePathName(name: String): PathMatcher

    matches if new File(path).

    matches if new File(path).getName == name

    Definition Classes
    PathBaseMatchers
  73. def hidden[T <: AnyRef { def getPath(): String }]: Matcher[AnyRef { def getPath(): String }]

    Definition Classes
    FileBeHaveMatchers
  74. def inputStream(filePath: String): InputStream

    returns

    a FileInputStream for a given file path

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

    returns

    true if the file is absolute

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

    returns

    true if the File represented by this path is a directory

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

    returns

    true if the file is a directory

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

    returns

    true if the file is a file

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

    returns

    true if the file is hidden

    Definition Classes
    FileSystem
  80. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  81. def listFiles(path: String): List[String]

    returns

    the files of that directory

    Definition Classes
    FileSystem
  82. def listPaths(list: String*): PathMatcher

    matches if new File(path).

    matches if new File(path).list == list(files)

    Definition Classes
    PathBaseMatchers
  83. def loadXhtmlFile(filePath: String, report: (Exception, String) ⇒ Unit = defaultLoadXhtmlFileReport, sourceErrors: Boolean = true): 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
  84. def loadXmlFile(filePath: String)(report: (Exception) ⇒ Unit = (e:Exception) => e.printStackTrace): NodeSeq

    returns

    the xml content of a file, using the XML parser

    Definition Classes
    FileReader
  85. def mkdirs(path: String): Boolean

    creates a new directory

    creates a new directory

    Definition Classes
    FileWriter
  86. def name[T <: AnyRef { def getPath(): String }](name: String): Matcher[AnyRef { def getPath(): String }]

    Definition Classes
    FileBeHaveMatchers
  87. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  88. final def notify(): Unit

    Definition Classes
    AnyRef
  89. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  90. def parent[T <: AnyRef { def getPath(): String }](path: String): Matcher[AnyRef { def getPath(): String }]

    Definition Classes
    FileBeHaveMatchers
  91. def parentPath(parent: String): PathMatcher

    Definition Classes
    PathBeHaveMatchers
  92. def pathName(name: String): PathMatcher

    Definition Classes
    PathBeHaveMatchers
  93. def paths[T <: AnyRef { def getPath(): String }](list: String): Matcher[AnyRef { def getPath(): String }]

    Definition Classes
    FileBeHaveMatchers
  94. 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
  95. def readLines(path: String): IndexedSeq[String]

    Definition Classes
    FileReader
  96. def readable[T <: AnyRef { def getPath(): String }]: Matcher[AnyRef { def getPath(): String }]

    Definition Classes
    FileBeHaveMatchers
  97. 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
  98. def samePath(p1: String, p2: String): Boolean

    returns

    true if 2 paths are the same according to their canonical representation

    Definition Classes
    FileSystem
  99. def silentLoadXhtmlFileReport: (Exception, String) ⇒ Unit

    Definition Classes
    FileReader
  100. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  101. implicit def toFileResultMatcher[T <: AnyRef { def getPath(): String }](result: MatchResult[T]): FileResultMatcher[T]

    matcher aliases and implicits to use with BeVerb and HaveVerb

    matcher aliases and implicits to use with BeVerb and HaveVerb

    Definition Classes
    FileBeHaveMatchers
  102. implicit def toPathResultMatcher(result: MatchResult[String]): PathResultMatcher

    matcher aliases and implicits to use with be / have + matcher

    matcher aliases and implicits to use with be / have + matcher

    Definition Classes
    PathBeHaveMatchers
  103. def toString(): String

    Definition Classes
    AnyRef → Any
  104. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  107. def writable[T <: AnyRef { def getPath(): String }]: Matcher[AnyRef { def getPath(): String }]

    Definition Classes
    FileBeHaveMatchers
  108. 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
  109. 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
  110. 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 FileBeHaveMatchers

Inherited from FileBaseMatchers

Inherited from PathMatchers

Inherited from PathBeHaveMatchers

Inherited from PathBaseMatchers

Inherited from FileSystem

Inherited from FileWriter

Inherited from FileReader

Inherited from AnyRef

Inherited from Any

Ungrouped