tests/testthat/test-git.R

context("git")

test_that("isGitProject identifies projects as sub-directories of git-managed folders as git projects", {
    skip_on_cran()

    dir <- file.path(tempdir(), "test-packrat-git")
    subdir <- file.path(dir, "subdir")
    dir.create(subdir, recursive = TRUE)
    dir.create(file.path(dir, ".git"))
    expect_true(isGitProject(dir))
    expect_true(isGitProject(subdir))
    expect_false(isGitProject(tempdir()))
    unlink(dir, recursive = TRUE)

})

Try the packrat package in your browser

Any scripts or data that you put into this service are public.

packrat documentation built on May 2, 2019, 6:24 a.m.