Test fixture functions for sandpaperSource:
This suite of functions are for use during testing of sandpaper and are
designed to create/work with a temporary lesson and associated remote
repository (locally) that persists throughout the test suite. These functions
are used in
tests/testthat/setup.R. For more information, see the package scope section of testthat article on Test Fixtures.
create_test_lesson() generate_restore_fixture(repo) setup_local_remote( repo, remote = tempfile(), name = "sandpaper-local", verbose = FALSE ) make_branch(repo, branch = NULL, name = "sandpaper-local", verbose = FALSE) clean_branch(repo, branch = NULL, name = "sandpaper-local", verbose = FALSE) remove_local_remote(repo, name = "sandpaper-local")
path to a git repository
path to an empty or uninitialized directory. Defaults to a tempfile
of the remote, defaults to "sandpaper-local"
TRUE, messages and output from git will be printed to screen. Defaults to
the name of the new branch to be deleted
generate_restore_fixture) a function that will restore the test fixture
setup_local_remote()) the repo, invisibly
remove_local_remote()) FALSE indicating an error or a string
indicating the path to the remote
This creates the test lesson and calls
generate_restore_fixture() with the
path of the new test lesson.
This creates a function that will restore a lesson to its previous commit.
Creates a local remote repository in a separate temporary folder, linked to the fixture lesson.