files

Library share/common/lib/files.yaml

given file (?P<embedded_file>\S+)

Create a file on disk from an embedded file in the subplot document. The created file has the same name as the embedded file.

Captures:

given file (?P<filename_on_disk>\S+) from (?P<embedded_file>\S+)

Create a file on disk from an embedded file in the subplot document. Set the name of the created file.

Captures:

when I write "(?P<text>.*)" to file (?P<filename>\S+)

Create a file on disk with the given content.

Captures:

given a directory (?P<path>\S+)

Create a directory on disk.

Captures:

when I create directory (?P<path>\S+)

Create a directory on disk.

Captures:

when I remove directory (?P<path>\S+)

Remove a directory on disk.

Captures:

then directory (?P<path>\S+) exists

Check that a directory exists.

Captures:

then directory (?P<path>\S+) does not exist

Check that a directory does not exist.

Captures:

then directory (?P<path>\S+) is empty

Check that a directory exists and does not contain anything.

Captures:

then directory (?P<path>\S+) is not empty

Check that a directory exists and contains something.

Captures:

given file (?P<filename>\S+) has modification time (?P<mtime>\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2})

Create a file with specific modification time.

Captures:

when I remember metadata for file (?P<filename>\S+)

Remember the metadata of a file.

Captures:

when I touch file (?P<filename>\S+)

Update the modification time of a file to be current time.

Captures:

then file (?P<filename>\S+) has same metadata as before

Check that a file has the same metadata as remembered from earlier.

Captures:

then file (?P<filename>\S+) has different metadata from before

Check that a file metadata has changed from earlier.

Captures:

then file (?P<filename>\S+) has changed from before

Check that file metadata has changed from before.

Captures:

then file (?P<filename>\S+) has a very recent modification time

Check that file modification time is recent.

Captures:

then file (?P<filename>\S+) has a very old modification time

Check that file modification is far in the past.

Captures:

then file (?P<filename>\S+) exists

Check that a file exist.

Captures:

then file (?P<filename>\S+) does not exist

Check that a file does not exist.

Captures:

then only files (?P<filenames>.+) exist

Check that the test directory only contains specific files.

Captures:

then file (?P<filename>\S+) contains "(?P<data>.*)"

Check that a file contains a string.

Captures:

then file (?P<filename>\S+) doesn't contain "(?P<data>.*)"

Check that a file does not contain a string.

Captures:

then file (?P<filename>\S+) matches regex /(?P<regex>.*)/

Check that file content matches a regular expression.

Captures:

then file (?P<filename>\S+) matches regex "(?P<regex>.*)"

Check that file content matches a regular expression.

Captures:

then files (?P<filename1>\S+) and (?P<filename2>\S+) match

Check that two files have the same content.

Captures: