From 4096c4906d5835292b9968d5261b91a1db9d89b6 Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Sun, 2 Oct 2016 15:58:01 +0100 Subject: Pr 311 2 (#312) * Add a setup test for middleware/file This fix adds a setup test for middleware/file so that there is a basic coverage for the Corefile processing of middleware/file. This fix is related to 308 (Will look into it). Signed-off-by: Yong Tang * middleware/file: use helper function for test Fixup setup_test.go and use the test.TempFile function to make things somewhat shorter. Use clean up the use of testing.T in TempFile - it is not used. --- middleware/test/file.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'middleware/test/file.go') diff --git a/middleware/test/file.go b/middleware/test/file.go index b6068a32b..626224cac 100644 --- a/middleware/test/file.go +++ b/middleware/test/file.go @@ -3,11 +3,10 @@ package test import ( "io/ioutil" "os" - "testing" ) // TempFile will create a temporary file on disk and returns the name and a cleanup function to remove it later. -func TempFile(t *testing.T, dir, content string) (string, func(), error) { +func TempFile(dir, content string) (string, func(), error) { f, err := ioutil.TempFile(dir, "go-test-tmpfile") if err != nil { return "", nil, err -- cgit v1.2.3