tests/testthat/test-fake_repo.R

test_that("fake_repo works", {
  repo_input <- tempfile(pattern = "git2r-")
  repo_output <- fake_repo(repo_input)

  branches <- git2r::branches(repo_output)

  expect_false(is.null(branches[["main"]]))

  all_commits <- git2r::commits(
    repo = repo_output, ref = "main",
    topological = TRUE, time = TRUE, reverse = FALSE
  )

  # expect_equal(repo_input, repo_output)
  expect_length(all_commits, 4)
})

Try the gitdown package in your browser

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

gitdown documentation built on March 18, 2022, 6:01 p.m.