Skip to content

Commit

Permalink
remove devtools::inst()
Browse files Browse the repository at this point in the history
close #26
  • Loading branch information
wibeasley committed Apr 13, 2021
1 parent 0cf635b commit f3210ab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions tests/testthat/test-extract.R
Expand Up @@ -2,9 +2,9 @@ library(testthat)

context("Extract")

path_1 <- base::file.path(devtools::inst(name="IalsaSynthesis"), "test-data/2015-portland/b1_female_a_grip_categories_4.out")
path_2 <- base::file.path(devtools::inst(name="IalsaSynthesis"), "test-data/2015-portland/b1_female_aehplus_gait_grip.out")
path_3 <- base::file.path(devtools::inst(name="IalsaSynthesis"), "test-data/2015-portland/b1_female_aehplus_grip_gait.out")
path_1 <- system.file(package="IalsaSynthesis", "test-data/2015-portland/b1_female_a_grip_categories_4.out")
path_2 <- system.file(package="IalsaSynthesis", "test-data/2015-portland/b1_female_aehplus_gait_grip.out")
path_3 <- system.file(package="IalsaSynthesis", "test-data/2015-portland/b1_female_aehplus_grip_gait.out")
output_1 <- readr::read_file(path_1)
output_2 <- readr::read_file(path_2)
output_3 <- readr::read_file(path_3)
Expand All @@ -13,7 +13,7 @@ output_3 <- readr::read_file(path_3)
# MplusAutomation::extractModelSummaries(path_1)
# MplusAutomation::extractModelParameters(path_1)

error_path <- base::file.path(devtools::inst(name="IalsaSynthesis"), "test-data/2015-portland/has-errors/b1_female_a_fev_mmse_5.out")
error_path <- system.file(package="IalsaSynthesis", "test-data/2015-portland/has-errors/b1_female_a_fev_mmse_5.out")
# m <- MplusAutomation::readModels(error_path)
# b1_female_a_fev_mmse_5.out

Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-validate.R
Expand Up @@ -4,7 +4,7 @@ context("Validate")


test_that("validate_filename_output -good", {
path <- base::file.path(devtools::inst(name="IalsaSynthesis"), "test-data/2015-portland")
path <- system.file(package="IalsaSynthesis", "test-data/2015-portland")

invisible_1 <- validate_filename_output("b1_female_a_grip_categories_4.out", path)
invisible_2 <- validate_filename_output("b1_female_aehplus_gait_grip.out", path)
Expand All @@ -16,7 +16,7 @@ test_that("validate_filename_output -good", {
})

test_that("validate_filename_output -missing", {
path <- base::file.path(devtools::inst(name="IalsaSynthesis"), "test-data/2015-portland")
path <- system.file(package="IalsaSynthesis", "test-data/2015-portland")
expected_error_regex <- "The output file was not found at .+"
expect_error(
regexp = expected_error_regex,
Expand All @@ -25,7 +25,7 @@ test_that("validate_filename_output -missing", {
})

test_that("validate_filename_output -bad extension", {
path <- base::file.path(devtools::inst(name="IalsaSynthesis"), "test-data/2015-portland")
path <- system.file(package="IalsaSynthesis", "test-data/2015-portland")
expected_error_regex <- "The output file extension `bad` did not match the expected value of `out`."
expect_error(
regexp = expected_error_regex,
Expand Down

0 comments on commit f3210ab

Please sign in to comment.