Skip to content

Commit b98e98d

Browse files
committed
Added unit tests for is_git() (#5)
1 parent f897159 commit b98e98d

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎tests/testthat/test-git.R‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11

2+
test_that("`is_git()` can detect whether it is in a Git repo", {
3+
dir <- tempfile("gitr-is_git-")
4+
dir.create(dir)
5+
withr::with_dir(dir, expect_false(suppressMessages(is_git())))
6+
withr::with_dir(".", expect_true(is_git()))
7+
})
8+
29
test_that("the basic functionality of `git()` works as expected", {
310
skip_if(isTRUE(Sys.which("git") == ""))
411
skip_if_not(is_git())

0 commit comments

Comments
 (0)