MCPcopy
hub / github.com/docker/compose / NewTempDirFixture

Function NewTempDirFixture

pkg/watch/temp_dir_fixture.go:41–55  ·  view source on GitHub ↗
(t testing.TB)

Source from the content-addressed store, hash-verified

39}
40
41func NewTempDirFixture(t testing.TB) *TempDirFixture {
42 dir, err := NewDir(SanitizeFileName(t.Name()))
43 if err != nil {
44 t.Fatalf("Error making temp dir: %v", err)
45 }
46
47 ret := &TempDirFixture{
48 t: t,
49 dir: dir,
50 }
51
52 t.Cleanup(ret.tearDown)
53
54 return ret
55}
56
57func (f *TempDirFixture) T() testing.TB {
58 return f.t

Callers 2

newNotifyFixtureFunction · 0.85

Calls 3

NewDirFunction · 0.85
SanitizeFileNameFunction · 0.85
NameMethod · 0.45

Tested by 2

newNotifyFixtureFunction · 0.68