mirror of
				https://github.com/coredns/coredns.git
				synced 2025-11-04 03:03:14 -05:00 
			
		
		
		
	* 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 <yong.tang.github@outlook.com> * 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.
		
			
				
	
	
		
			12 lines
		
	
	
		
			179 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			12 lines
		
	
	
		
			179 B
		
	
	
	
		
			Go
		
	
	
	
	
	
package test
 | 
						|
 | 
						|
import "testing"
 | 
						|
 | 
						|
func TestTempFile(t *testing.T) {
 | 
						|
	_, f, e := TempFile(".", "test")
 | 
						|
	if e != nil {
 | 
						|
		t.Fatalf("failed to create temp file: %s", e)
 | 
						|
	}
 | 
						|
	defer f()
 | 
						|
}
 |