diff options
author | Santiago M. Mola <santi@mola.io> | 2016-10-25 11:32:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-25 11:32:11 +0200 |
commit | f87b26504f684140edc9eb80258c3f27c91b92be (patch) | |
tree | 75ddd427b28a6cc60f13c5b670733bc363c63675 /utils/fs/test/fs_suite.go | |
parent | cad256efb13b9067c2664001d5713507694bc411 (diff) | |
download | go-git-f87b26504f684140edc9eb80258c3f27c91b92be.tar.gz |
utils/fs: add test for create file in dir. (#95)
* Ensure that files can be created in a FS returned
by Dir().
* Files created in a dir fs should have Filename()
relative to dir's base.
Diffstat (limited to 'utils/fs/test/fs_suite.go')
-rw-r--r-- | utils/fs/test/fs_suite.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/utils/fs/test/fs_suite.go b/utils/fs/test/fs_suite.go index 055839e..e8e04ab 100644 --- a/utils/fs/test/fs_suite.go +++ b/utils/fs/test/fs_suite.go @@ -95,6 +95,14 @@ func (s *FilesystemSuite) TestReadDirAndDir(c *C) { c.Assert(info, HasLen, 2) } +func (s *FilesystemSuite) TestCreateInDir(c *C) { + dir := s.Fs.Dir("foo") + f, err := dir.Create("bar") + c.Assert(err, IsNil) + c.Assert(f.Close(), IsNil) + c.Assert(f.Filename(), Equals, "bar") +} + func (s *FilesystemSuite) TestRename(c *C) { f, err := s.Fs.Create("foo") c.Assert(err, IsNil) |