From 5c98ab6554f84e3bb68e19e6bd64ad7e21fc818f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20P=C4=99czkowski?= Date: Sun, 7 Nov 2021 00:43:53 +0100 Subject: [PATCH] Use local repository for SyncCommand tests --- commands/sync_cmd_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/commands/sync_cmd_test.go b/commands/sync_cmd_test.go index bed4eaf..2d5b089 100644 --- a/commands/sync_cmd_test.go +++ b/commands/sync_cmd_test.go @@ -17,14 +17,14 @@ func TestSyncInit(t *testing.T) { func TestSyncCommand(t *testing.T) { - workdir := createTmpDir() + testSetup := getTestSetup() sync := Synchronizer{ - workspace: workdir, + workspace: testSetup.rootFS.Root(), } cfg := config.RepositoryConfig{ - Src: "https://github.com/avelino/awesome-go", + Src: fmt.Sprintf("file://%v", testSetup.baseRepository.fileSystem.Root()), Dest: "awesome-go", } @@ -38,7 +38,7 @@ func TestSyncCommand(t *testing.T) { t.Errorf("Unexpected error: %v", cloneStatus.Message) } - info, err := os.Stat(fmt.Sprintf("%v/awesome-go/.git", workdir)) + info, err := os.Stat(fmt.Sprintf("%v/awesome-go/.git", testSetup.rootFS.Root())) if err != nil { t.Errorf("Unexpected error: %v", err.Error()) }