From d45eb0402b2f3dace2ed1f91ee53e2c591a7ba3c Mon Sep 17 00:00:00 2001 From: "Santiago M. Mola" Date: Mon, 24 Oct 2016 15:14:22 +0200 Subject: utils/fs: move 'os' and 'test' to separate packages. (#93) * create utils/fs/test package to expose generic test suite to 3rd party fs implementations. * move 'os' to its own package to avoid cyclic dependency (test -> fs -> test, becomes test -> fs, os -> test, os -> fs). * remove TestCreateAndWrite: some of our implementations cannot read a file that was just created, written and not closed yet. --- utils/fs/os/os_test.go | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 utils/fs/os/os_test.go (limited to 'utils/fs/os/os_test.go') diff --git a/utils/fs/os/os_test.go b/utils/fs/os/os_test.go new file mode 100644 index 0000000..02a0a6c --- /dev/null +++ b/utils/fs/os/os_test.go @@ -0,0 +1,29 @@ +package os_test + +import ( + "io/ioutil" + stdos "os" + "testing" + + . "gopkg.in/check.v1" + "gopkg.in/src-d/go-git.v4/utils/fs/os" + "gopkg.in/src-d/go-git.v4/utils/fs/test" +) + +func Test(t *testing.T) { TestingT(t) } + +type OSSuite struct { + test.FilesystemSuite + path string +} + +var _ = Suite(&OSSuite{}) + +func (s *OSSuite) SetUpTest(c *C) { + s.path, _ = ioutil.TempDir(stdos.TempDir(), "go-git-os-fs-test") + s.FilesystemSuite.Fs = os.NewOS(s.path) +} +func (s *OSSuite) TearDownTest(c *C) { + err := stdos.RemoveAll(s.path) + c.Assert(err, IsNil) +} -- cgit