shithub: hugo

Download patch

ref: c6c2c689d602cf9d0a9bdf016e3a51a54030b072
parent: b678e90db74edc4f8d5502c1a367db5cec58e0c5
author: Bjørn Erik Pedersen <[email protected]>
date: Fri Apr 1 21:23:12 EDT 2016

hugofs: Add missing not nil checks to tests

--- a/hugofs/fs_test.go
+++ b/hugofs/fs_test.go
@@ -26,8 +26,11 @@
 
 	InitDefaultFs()
 
+	assert.NotNil(t, Source())
 	assert.IsType(t, new(afero.OsFs), Source())
+	assert.NotNil(t, Destination())
 	assert.IsType(t, new(afero.OsFs), Destination())
+	assert.NotNil(t, Os())
 	assert.IsType(t, new(afero.OsFs), Os())
 	assert.Nil(t, WorkingDir())
 }
@@ -38,7 +41,9 @@
 
 	InitMemFs()
 
+	assert.NotNil(t, Source())
 	assert.IsType(t, new(afero.MemMapFs), Source())
+	assert.NotNil(t, Destination())
 	assert.IsType(t, new(afero.MemMapFs), Destination())
 	assert.IsType(t, new(afero.OsFs), Os())
 	assert.Nil(t, WorkingDir())
@@ -49,6 +54,7 @@
 	InitMemFs()
 
 	SetSource(new(afero.OsFs))
+	assert.NotNil(t, Source())
 	assert.IsType(t, new(afero.OsFs), Source())
 }
 
@@ -57,6 +63,7 @@
 	InitMemFs()
 
 	SetDestination(new(afero.OsFs))
+	assert.NotNil(t, Destination())
 	assert.IsType(t, new(afero.OsFs), Destination())
 }
 
@@ -68,5 +75,6 @@
 
 	InitMemFs()
 
+	assert.NotNil(t, WorkingDir())
 	assert.IsType(t, new(afero.BasePathFs), WorkingDir())
 }