You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

temporal_test.go 650B

123456789101112131415161718192021222324252627282930313233
  1. package temporal
  2. import (
  3. "strings"
  4. "testing"
  5. "gopkg.in/src-d/go-billy.v4/memfs"
  6. "gopkg.in/src-d/go-billy.v4/test"
  7. . "gopkg.in/check.v1"
  8. )
  9. func Test(t *testing.T) { TestingT(t) }
  10. var _ = Suite(&TemporalSuite{})
  11. type TemporalSuite struct {
  12. test.FilesystemSuite
  13. }
  14. func (s *TemporalSuite) SetUpTest(c *C) {
  15. fs := New(memfs.New(), "foo")
  16. s.FilesystemSuite = test.NewFilesystemSuite(fs)
  17. }
  18. func (s *TemporalSuite) TestTempFileDefaultPath(c *C) {
  19. fs := New(memfs.New(), "foo")
  20. f, err := fs.TempFile("", "bar")
  21. c.Assert(err, IsNil)
  22. c.Assert(f.Close(), IsNil)
  23. c.Assert(strings.HasPrefix(f.Name(), fs.Join("foo", "bar")), Equals, true)
  24. }