github.com/loggregator/cli@v6.33.1-0.20180224010324-82334f081791+incompatible/cf/appfiles/appfilesfakes/fake_cf_ignore.go (about) 1 // This file was generated by counterfeiter 2 package appfilesfakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/cf/appfiles" 8 ) 9 10 type FakeCfIgnore struct { 11 FileShouldBeIgnoredStub func(path string) bool 12 fileShouldBeIgnoredMutex sync.RWMutex 13 fileShouldBeIgnoredArgsForCall []struct { 14 path string 15 } 16 fileShouldBeIgnoredReturns struct { 17 result1 bool 18 } 19 invocations map[string][][]interface{} 20 invocationsMutex sync.RWMutex 21 } 22 23 func (fake *FakeCfIgnore) FileShouldBeIgnored(path string) bool { 24 fake.fileShouldBeIgnoredMutex.Lock() 25 fake.fileShouldBeIgnoredArgsForCall = append(fake.fileShouldBeIgnoredArgsForCall, struct { 26 path string 27 }{path}) 28 fake.recordInvocation("FileShouldBeIgnored", []interface{}{path}) 29 fake.fileShouldBeIgnoredMutex.Unlock() 30 if fake.FileShouldBeIgnoredStub != nil { 31 return fake.FileShouldBeIgnoredStub(path) 32 } else { 33 return fake.fileShouldBeIgnoredReturns.result1 34 } 35 } 36 37 func (fake *FakeCfIgnore) FileShouldBeIgnoredCallCount() int { 38 fake.fileShouldBeIgnoredMutex.RLock() 39 defer fake.fileShouldBeIgnoredMutex.RUnlock() 40 return len(fake.fileShouldBeIgnoredArgsForCall) 41 } 42 43 func (fake *FakeCfIgnore) FileShouldBeIgnoredArgsForCall(i int) string { 44 fake.fileShouldBeIgnoredMutex.RLock() 45 defer fake.fileShouldBeIgnoredMutex.RUnlock() 46 return fake.fileShouldBeIgnoredArgsForCall[i].path 47 } 48 49 func (fake *FakeCfIgnore) FileShouldBeIgnoredReturns(result1 bool) { 50 fake.FileShouldBeIgnoredStub = nil 51 fake.fileShouldBeIgnoredReturns = struct { 52 result1 bool 53 }{result1} 54 } 55 56 func (fake *FakeCfIgnore) Invocations() map[string][][]interface{} { 57 fake.invocationsMutex.RLock() 58 defer fake.invocationsMutex.RUnlock() 59 fake.fileShouldBeIgnoredMutex.RLock() 60 defer fake.fileShouldBeIgnoredMutex.RUnlock() 61 return fake.invocations 62 } 63 64 func (fake *FakeCfIgnore) recordInvocation(key string, args []interface{}) { 65 fake.invocationsMutex.Lock() 66 defer fake.invocationsMutex.Unlock() 67 if fake.invocations == nil { 68 fake.invocations = map[string][][]interface{}{} 69 } 70 if fake.invocations[key] == nil { 71 fake.invocations[key] = [][]interface{}{} 72 } 73 fake.invocations[key] = append(fake.invocations[key], args) 74 } 75 76 var _ appfiles.CfIgnore = new(FakeCfIgnore)