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"
the name of the new branch to be deleted
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.
create a branch in the local repository and push it to the remote repository.
delete a branch in the local and remote repository.
Destorys the local remote repository and removes it from the fixture lesson
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
These are implemented in tests/testthat/setup.md
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.