Exemple #1
0
func TestDir(t *testing.T) {
	var dirname string

	assert.Nil(t, Dir(func(name string) {
		ioutil.TempFile(name, "")

		dirname = name
	}))

	assert.False(t, fileExists(dirname))
}
Exemple #2
0
func TestEmptyDir(t *testing.T) {
	var dirname string

	Dir(func(name string) {
		fi, err := os.Stat(name)
		assert.Nil(t, err)
		assert.True(t, fi.Mode().IsDir())

		dirname = name
	})

	assert.False(t, fileExists(dirname))
}
Exemple #3
0
func TestFile(t *testing.T) {
	var filename string

	File(func(name string) {
		fi, err := os.Stat(name)
		assert.Nil(t, err)
		assert.True(t, fi.Mode().IsRegular())

		filename = name
	})

	assert.False(t, fileExists(filename))
}