forked from cloudfoundry/bosh-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_writer.go
57 lines (49 loc) · 1.31 KB
/
fake_writer.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// This file was generated by counterfeiter
package fakes
import (
"sync"
"github.com/cloudfoundry/bosh-cli/release"
)
type FakeWriter struct {
WriteStub func(release.Release, []string) (string, error)
writeMutex sync.RWMutex
writeArgsForCall []struct {
arg1 release.Release
arg2 []string
}
writeReturns struct {
result1 string
result2 error
}
}
func (fake *FakeWriter) Write(arg1 release.Release, arg2 []string) (string, error) {
fake.writeMutex.Lock()
fake.writeArgsForCall = append(fake.writeArgsForCall, struct {
arg1 release.Release
arg2 []string
}{arg1, arg2})
fake.writeMutex.Unlock()
if fake.WriteStub != nil {
return fake.WriteStub(arg1, arg2)
} else {
return fake.writeReturns.result1, fake.writeReturns.result2
}
}
func (fake *FakeWriter) WriteCallCount() int {
fake.writeMutex.RLock()
defer fake.writeMutex.RUnlock()
return len(fake.writeArgsForCall)
}
func (fake *FakeWriter) WriteArgsForCall(i int) (release.Release, []string) {
fake.writeMutex.RLock()
defer fake.writeMutex.RUnlock()
return fake.writeArgsForCall[i].arg1, fake.writeArgsForCall[i].arg2
}
func (fake *FakeWriter) WriteReturns(result1 string, result2 error) {
fake.WriteStub = nil
fake.writeReturns = struct {
result1 string
result2 error
}{result1, result2}
}
var _ release.Writer = new(FakeWriter)