Description Usage Arguments Value Examples
View source: R/expect_is_file.R
Return an error if a string represents an existent file.
Return an error if a string represents an existent directory.
1 2 3 | expect_is_file(potential_filepath, ...)
expect_is_directory(potential_filepath, ...)
|
potential_filepath |
character. The name of the file path to check. |
... |
additional arguments to pass to |
TRUE or FALSE according as potential_filepath
is or is not
a file.
TRUE or FALSE according as potential_path
is or is not
a directory.
1 2 3 4 5 6 7 8 9 | library(testthat)
# expect_error(expect_is_file('not/a/file')) # will error
tmp <- tempfile(); writeLines('', tmp)
expect_is_file(tmp) # will not error
## Not run:
# expect_is_directory('not/a/dir') # will error
expect_is_directory(dirname(tempfile())) # will not error
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.