diff --git a/internal/core/processing_test.go b/internal/core/processing_test.go index 89f7cf2dc4..bc222453cb 100644 --- a/internal/core/processing_test.go +++ b/internal/core/processing_test.go @@ -5,6 +5,7 @@ import ( "context" "net/http" "net/http/httptest" + "path/filepath" "testing" "github.com/go-shiori/shiori/internal/core" @@ -45,6 +46,7 @@ func TestDownloadBookImage(t *testing.T) { assert.True(t, deps.Domains.Storage.FileExists(dstFile)) }) t.Run("successful download medium size image", func(t *testing.T) { + tempDir := t.TempDir() // create a file server handler for the 'testdata' directory fs := http.FileServer(http.Dir("../../testdata/")) @@ -54,7 +56,7 @@ func TestDownloadBookImage(t *testing.T) { // Arrange imageURL := server.URL + "/medium_image.png" - dstFile := "tempDir/medium_image.png" + dstFile := filepath.Join(tempDir, "medium_image.png") // Act err := core.DownloadBookImage(deps, imageURL, dstFile)