Skip to content

Commit

Permalink
better coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
M-Kusumgar committed Jan 24, 2024
1 parent 01649f4 commit 2382ece
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 1 addition & 6 deletions R/util_assert.R
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,7 @@ assert_one_file_exists_relative <- function(filenames, workdir, name, call = NUL
file_exists(filename, workdir = workdir)
}))

if (length(which_files_exist) > 1) {
cli::cli_abort(
c("Please create only ONE of {paste(filenames, collapse = ', ')} files",
i = "Looked within directory '{workdir}'"),
call = call)
} else if (length(which_files_exist) == 0) {
if (length(which_files_exist) != 1) {
cli::cli_abort(
c("Please create ONE of {paste(filenames, collapse = ', ')} files",
i = "Looked within directory '{workdir}'"),
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-orderly.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ test_that("error if <reportname>.R exists already", {
test_that("error if <reportname>.R and orderly.R both exist", {
path <- test_prepare_orderly_example("bad-ex-two-orderly-files")
expect_error(orderly_run("bad-ex-two-orderly-files", root = path),
paste("Please create only ONE of bad-ex-two-orderly-files.R,",
paste("Please create ONE of bad-ex-two-orderly-files.R,",
"orderly.R files"))
})

Expand Down

0 comments on commit 2382ece

Please sign in to comment.