tests/testthat/test-project.R

context("unit test for project functions")

test_that("getProject works when there .project doesn't exist", {
    .delete_project_env()

    expect_null(getProject(x))
})

test_that("getProject works when there .project exists", {
    .create_project_env()

    .project$path_proj <- getwd()
    expect_equal(getProject("path_proj"), getwd())

    .project$path_proj <- NULL
    expect_null(getProject("path_proj"))
})
tidylab/tidylab.deployment documentation built on June 9, 2019, 11:41 a.m.