diff options
Diffstat (limited to 'utils/fs/test')
-rw-r--r-- | utils/fs/test/fs_suite.go | 22 |
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") } |