github.com/makyo/juju@v0.0.0-20160425123129-2608902037e9/service/systemd/stubfileops_test.go (about) 1 // Copyright 2015 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package systemd 5 6 import ( 7 "os" 8 9 "github.com/juju/testing" 10 ) 11 12 type StubFileOps struct { 13 *testing.Stub 14 } 15 16 func (sfo *StubFileOps) RemoveAll(name string) error { 17 sfo.AddCall("RemoveAll", name) 18 19 return sfo.NextErr() 20 } 21 22 func (sfo *StubFileOps) MkdirAll(dirname string) error { 23 sfo.AddCall("MkdirAll", dirname) 24 25 return sfo.NextErr() 26 } 27 28 func (sfo *StubFileOps) CreateFile(filename string, data []byte, perm os.FileMode) error { 29 sfo.AddCall("CreateFile", filename, data, perm) 30 31 return sfo.NextErr() 32 }