Improve code readability #1

+ Improved tests readability of common_utils_test.go
+ Fixed minor typos
This commit is contained in:
Mikołaj Pęczkowski 2024-06-13 21:19:04 +02:00
parent 8cd3ed2127
commit 68636d5e64
8 changed files with 167 additions and 123 deletions

View file

@ -16,14 +16,14 @@ func TestSyncInit(t *testing.T) {
func TestSyncCommand(t *testing.T) {
testSetup := getTestSetup()
pathsToTest := prepareBasicRepository()
sync := Synchronizer{
workspace: testSetup.rootFS.Root(),
workspace: pathsToTest.baseTestDirectory,
}
cfg := config.RepositoryConfig{
Src: fmt.Sprintf("file://%v", testSetup.baseRepository.fileSystem.Root()),
Src: fmt.Sprintf("file://%v", pathsToTest.baseTestRepository),
Dest: "awesome-go",
}
@ -32,10 +32,11 @@ func TestSyncCommand(t *testing.T) {
t.Errorf("Unexpected error: %v", cloneStatus.Message)
}
info, err := os.Stat(fmt.Sprintf("%v/awesome-go/.git", testSetup.rootFS.Root()))
info, err := os.Stat(fmt.Sprintf("%v/awesome-go/.git", pathsToTest.baseTestDirectory))
if err != nil {
t.Errorf("Unexpected error: %v", err.Error())
}
if !info.IsDir() {
t.Errorf("Expected that the selected path is dir")
}