File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -15,11 +15,12 @@ func Test(t *testing.T) { TestingT(t) }
15
15
var _ = Suite (& TemporalSuite {})
16
16
17
17
type TemporalSuite struct {
18
- test.TempFileSuite
18
+ test.FilesystemSuite
19
19
}
20
20
21
21
func (s * TemporalSuite ) SetUpTest (c * C ) {
22
- s .FS = New (memfs .New (), "foo" )
22
+ fs := New (memfs .New (), "foo" )
23
+ s .FilesystemSuite = test .NewFilesystemSuite (fs )
23
24
}
24
25
25
26
func (s * TemporalSuite ) TestTempFileDefaultPath (c * C ) {
Original file line number Diff line number Diff line change @@ -46,11 +46,19 @@ func (s *TempFileSuite) TestRemoveTempFile(c *C) {
46
46
c .Assert (err , IsNil )
47
47
48
48
fn := f .Name ()
49
- c .Assert (err , IsNil )
50
49
c .Assert (f .Close (), IsNil )
51
50
c .Assert (s .FS .Remove (fn ), IsNil )
52
51
}
53
52
53
+ func (s * TempFileSuite ) TestRenameTempFile (c * C ) {
54
+ f , err := s .FS .TempFile ("test-dir" , "test-prefix" )
55
+ c .Assert (err , IsNil )
56
+
57
+ fn := f .Name ()
58
+ c .Assert (f .Close (), IsNil )
59
+ c .Assert (s .FS .Rename (fn , "other-path" ), IsNil )
60
+ }
61
+
54
62
func (s * TempFileSuite ) TestTempFileMany (c * C ) {
55
63
for i := 0 ; i < 1024 ; i ++ {
56
64
var fs []billy.File
You can’t perform that action at this time.
0 commit comments