aboutsummaryrefslogtreecommitdiffstats
path: root/utils/fs/test
diff options
context:
space:
mode:
authorSantiago M. Mola <santi@mola.io>2016-10-24 15:22:17 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2016-10-24 15:22:17 +0200
commitcad256efb13b9067c2664001d5713507694bc411 (patch)
treeb0b9c0653432865483c69e2cbc78c1f51718228b /utils/fs/test
parentd45eb0402b2f3dace2ed1f91ee53e2c591a7ba3c (diff)
downloadgo-git-cad256efb13b9067c2664001d5713507694bc411.tar.gz
utils/fs: add Remove(). (#94)
Diffstat (limited to 'utils/fs/test')
-rw-r--r--utils/fs/test/fs_suite.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/utils/fs/test/fs_suite.go b/utils/fs/test/fs_suite.go
index 109311f..055839e 100644
--- a/utils/fs/test/fs_suite.go
+++ b/utils/fs/test/fs_suite.go
@@ -149,6 +149,28 @@ func (s *FilesystemSuite) TestOpenAndStat(c *C) {
c.Assert(stat.Name(), Equals, "foo")
}
+func (s *FilesystemSuite) TestRemove(c *C) {
+ f, err := s.Fs.Create("foo")
+ c.Assert(err, IsNil)
+ c.Assert(f.Close(), IsNil)
+
+ err = s.Fs.Remove("foo")
+ c.Assert(err, IsNil)
+}
+
+func (s *FilesystemSuite) TestRemoveNonExisting(c *C) {
+ c.Assert(s.Fs.Remove("NON-EXISTING"), NotNil)
+}
+
+func (s *FilesystemSuite) TestRemoveTempFile(c *C) {
+ f, err := s.Fs.TempFile("test-dir", "test-prefix")
+ fn := f.Filename()
+ c.Assert(err, IsNil)
+ c.Assert(f.Close(), IsNil)
+
+ c.Assert(s.Fs.Remove(fn), IsNil)
+}
+
func (s *FilesystemSuite) TestJoin(c *C) {
c.Assert(s.Fs.Join("foo", "bar"), Equals, "foo/bar")
}