Skip to content

Commit

Permalink
fix: replace test_path with system.file
Browse files Browse the repository at this point in the history
  • Loading branch information
sgibb committed Jun 9, 2024
1 parent 54b5887 commit 18217bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions tests/testthat/test_read_dltr.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ test_that("read_dltr throws errors", {

test_that("read_dltr returns a data.table", {
expect_true(
is.data.table(read_dltr(test_path("..", "..", "inst", "logbook.txt")))
is.data.table(read_dltr(system.file("logbook.txt", package = "dltr")))
)
})

Expand All @@ -17,11 +17,11 @@ test_that("is_trends_file throws errors", {
})

test_that("is_logbook_file works", {
expect_true(is_logbook_file(test_path("..", "..", "inst", "logbook.txt")))
expect_false(is_logbook_file(test_path("..", "..", "inst", "trends.txt")))
expect_true(is_logbook_file(system.file("logbook.txt", package = "dltr")))
expect_false(is_logbook_file(system.file("trends.txt", package = "dltr")))
})

test_that("is_trends_file works", {
expect_true(is_trends_file(test_path("..", "..", "inst", "trends.txt")))
expect_false(is_trends_file(test_path("..", "..", "inst", "logbook.txt")))
expect_true(is_trends_file(system.file("trends.txt", package = "dltr")))
expect_false(is_trends_file(system.file("logbook.txt", package = "dltr")))
})
2 changes: 1 addition & 1 deletion tests/testthat/test_read_logbook.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ test_that(".read_logbook throws errors", {
})

test_that(".read_logbook", {
lb <- .read_logbook(test_path("..", "..", "inst", "logbook.txt"))
lb <- .read_logbook(system.file("logbook.txt", package = "dltr"))

expect_true(is.data.table(lb))

Expand Down

0 comments on commit 18217bf

Please sign in to comment.