package strikt.java
Subpackages
Name | Description |
---|---|
package strikt.java.time
|
Fields
Name | Description |
---|---|
val name: Builder
|
Maps this assertion to an assertion on the name of the file of the subject. |
val parent: Builder
|
Maps this assertion to an assertion on the parent file or |
val parentFile: Builder
|
Maps this assertion to an assertion on the parent file or |
val extension: Builder
|
Maps this assertion to an assertion on the file extension (not including the dot) or empty string if it not have one. |
val nameWithoutExtension: Builder
|
Maps this assertion to an assertion on the file name without the extension. |
val lastModified: Builder
|
Maps this assertion to an assertion on the last modified of the subject. |
val length: Builder
|
Maps this assertion to an assertion on the file size of the subject. |
val childFiles: Builder
|
Maps this assertion to an assertion on the child files of the subject. Note: In contrast to File.listFiles, an empty list is returned for non-directory files. |
val fileName: Builder
|
Maps this assertion to an assertion on the path representing the name of the subject. |
val size: Builder
|
Maps this assertion to an assertion over the byte size of the subject path. |
Methods
propertiesAreEqualTo
infix fun <T : Any> Assertion.Builder
Receiver
Name | Description |
---|---|
Assertion.Builder
|
Parameters
Name | Description |
---|---|
other: T
|
ReturnValue
Name | Description |
---|---|
Assertion.Builder
|
propertiesAreEqualToIgnoring
fun <T : Any> Assertion.Builder
Asserts that all properties of the subject except ignoredProperties match those of other according to either contentEquals in the case of array properties or isEqualTo in other cases.
Properties are identified using Java beans conventions.
Receiver
Name | Description |
---|---|
Assertion.Builder
|
Parameters
Name | Description |
---|---|
other: T
|
|
vararg ignoredProperties: KProperty1<T, Any>
|
ReturnValue
Name | Description |
---|---|
Assertion.Builder
|
toPath
fun <T : File> Builder
Maps this assertion to an assertion on a path object representing this subject.
Receiver
Name | Description |
---|---|
Builder
|
ReturnValue
Name | Description |
---|---|
Builder
|
lines
fun <T : File> Builder
><List<String>>
Maps this assertion to an assertion on the lines of the subject decoded using the provided charset.
Receiver
Name | Description |
---|---|
Builder
|
Parameters
Name | Description |
---|---|
charset: Charset
|
the charset used to decode the content |
ReturnValue
Name | Description |
---|---|
Builder
|
text
fun <T : File> Builder
Maps this assertion to an assertion on the complete text of the subject decoded using the provided charset.
Receiver
Name | Description |
---|---|
Builder
|
Parameters
Name | Description |
---|---|
charset: Charset
|
the charset used to decode the content |
ReturnValue
Name | Description |
---|---|
Builder
|
childFile
fun <T : File> Builder
Maps this assertion to an assertion on a specific child name of the subject.
Receiver
Name | Description |
---|---|
Builder
|
Parameters
Name | Description |
---|---|
name: String
|
ReturnValue
Name | Description |
---|---|
Builder
|
exists
fun <T : File> Builder
Asserts that the file exists.
Receiver
Name | Description |
---|---|
Builder
|
ReturnValue
Name | Description |
---|---|
Builder
|
exists
fun <T : Path> Builder
Asserts that the subject exists, handling symbolic links according to the provided options
Receiver
Name | Description |
---|---|
Builder
|
Parameters
Name | Description |
---|---|
vararg options: LinkOption
|
the options indicating how symbolic links are handled |
ReturnValue
Name | Description |
---|---|
Builder
|
notExists
fun <T : File> Builder
Asserts that the file not exists.
Receiver
Name | Description |
---|---|
Builder
|
ReturnValue
Name | Description |
---|---|
Builder
|
isRegularFile
fun <T : File> Builder
Asserts that the file is a regular file.
Receiver
Name | Description |
---|---|
Builder
|
ReturnValue
Name | Description |
---|---|
Builder
|
isRegularFile
fun <T : Path> Builder
Asserts that the subject is a regular file, handling symbolic links according to the provided options.
Receiver
Name | Description |
---|---|
Builder
|
Parameters
Name | Description |
---|---|
vararg options: LinkOption
|
the options indicating how symbolic links are handled |
ReturnValue
Name | Description |
---|---|
Builder
|
isNotRegularFile
fun <T : File> Builder
Asserts that the file is not a regular file.
Receiver
Name | Description |
---|---|
Builder
|
ReturnValue
Name | Description |
---|---|
Builder
|
isDirectory
fun <T : File> Builder
Asserts that the file is a directory.
Receiver
Name | Description |
---|---|
Builder
|
ReturnValue
Name | Description |
---|---|
Builder
|
isDirectory
fun <T : Path> Builder
Asserts that the subject is a directory, handling symbolic links according to the provided options.
Receiver
Name | Description |
---|---|
Builder
|
Parameters
Name | Description |
---|---|
vararg options: LinkOption
|
the options indicating how symbolic links are handled |
ReturnValue
Name | Description |
---|---|
Builder
|
isNotDirectory
fun <T : File> Builder
Asserts that the file is not a directory.
Receiver
Name | Description |
---|---|
Builder
|
ReturnValue
Name | Description |
---|---|
Builder
|
isReadable
fun <T : File> Builder
Asserts that the file is readable.
Receiver
Name | Description |
---|---|
Builder
|
ReturnValue
Name | Description |
---|---|
Builder
|
isNotReadable
fun <T : File> Builder
Asserts that the file is not readable.
Receiver
Name | Description |
---|---|
Builder
|
ReturnValue
Name | Description |
---|---|
Builder
|
isWritable
fun <T : File> Builder
Asserts that the file is writable.
Receiver
Name | Description |
---|---|
Builder
|
ReturnValue
Name | Description |
---|---|
Builder
|
isNotWritable
fun <T : File> Builder
Asserts that the file is not writable.
Receiver
Name | Description |
---|---|
Builder
|
ReturnValue
Name | Description |
---|---|
Builder
|
isExecutable
fun <T : File> Builder
Asserts that the file is executable.
Receiver
Name | Description |
---|---|
Builder
|
ReturnValue
Name | Description |
---|---|
Builder
|
isNotExecutable
fun <T : File> Builder
Asserts that the file is not executable.
Receiver
Name | Description |
---|---|
Builder
|
ReturnValue
Name | Description |
---|---|
Builder
|
isPresent
fun <T> Assertion.Builder
Asserts that an Optional
contains a value (is not empty) and returns an
assertion builder whose subject is the value.
Receiver
Name | Description |
---|---|
Assertion.Builder
|
ReturnValue
Name | Description |
---|---|
Assertion.Builder
|
isAbsent
fun <T> Assertion.Builder
Asserts that an Optional
does not contain a value.
Receiver
Name | Description |
---|---|
Assertion.Builder
|
ReturnValue
Name | Description |
---|---|
Assertion.Builder
|
toNullable
fun <T> Assertion.Builder
Maps an assertion on a Java Optional
to a Kotlin nullable type.
Receiver
Name | Description |
---|---|
Assertion.Builder
|
ReturnValue
Name | Description |
---|---|
Assertion.Builder
|
endsWith
infix fun <T : Path> Builder
Asserts that the subject end with the provided path.
Receiver
Name | Description |
---|---|
Builder
|
Parameters
Name | Description |
---|---|
other: Path
|
the given path |
ReturnValue
Name | Description |
---|---|
Builder
|
endsWith
infix fun <T : Path> Builder
Asserts that the subject end with the provided path string.
Receiver
Name | Description |
---|---|
Builder
|
Parameters
Name | Description |
---|---|
other: String
|
the given path string |
ReturnValue
Name | Description |
---|---|
Builder
|
isAbsolute
fun <T : Path> Builder
Asserts that the subject is an absolute path.
Receiver
Name | Description |
---|---|
Builder
|
ReturnValue
Name | Description |
---|---|
Builder
|
resolve
infix fun <T : Path> Builder
Maps this assertion to an assertion of this subject resolved with the provided path.
Receiver
Name | Description |
---|---|
Builder
|
Parameters
Name | Description |
---|---|
other: Path
|
the path to resolve against this subject's path |
ReturnValue
Name | Description |
---|---|
Builder
|
resolve
infix fun <T : Path> Builder
Maps this assertion to an assertion of this subject resolved with the provided path.
Receiver
Name | Description |
---|---|
Builder
|
Parameters
Name | Description |
---|---|
other: String
|
the path string to resolve against this subject's path |
ReturnValue
Name | Description |
---|---|
Builder
|
startsWith
infix fun <T : Path> Builder
Asserts that the subject starts with the provided path.
Receiver
Name | Description |
---|---|
Builder
|
Parameters
Name | Description |
---|---|
other: Path
|
the given path |
ReturnValue
Name | Description |
---|---|
Builder
|
startsWith
infix fun <T : Path> Builder
Asserts that the subject starts with the provided path.
Receiver
Name | Description |
---|---|
Builder
|
Parameters
Name | Description |
---|---|
other: String
|
the given path string |
ReturnValue
Name | Description |
---|---|
Builder
|
toFile
fun <T : Path> Builder
Maps this assertion to an assertion on the file object representing this subject.
Receiver
Name | Description |
---|---|
Builder
|
ReturnValue
Name | Description |
---|---|
Builder
|
isSymbolicLink
fun <T : Path> Builder
Asserts that the subject is a symbolic link.
Receiver
Name | Description |
---|---|
Builder
|
ReturnValue
Name | Description |
---|---|
Builder
|
allBytes
fun <T : Path> Builder
Maps this assertion to an assertion over all bytes of this subject path .
Receiver
Name | Description |
---|---|
Builder
|
ReturnValue
Name | Description |
---|---|
Builder
|
allLines
fun <T : Path> Builder
><List<String>>
Maps this assertion to an assertion over all lines of this subject path decoded using the provided charset.
Receiver
Name | Description |
---|---|
Builder
|
Parameters
Name | Description |
---|---|
charset: Charset
|
the charset to use in decoding |
ReturnValue
Name | Description |
---|---|
Builder
|
Asserts that all properties of the subject match those of other according to either contentEquals in the case of array properties or isEqualTo in other cases.
Properties are identified using Java beans conventions.