forked from cloudfoundry/bosh-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_parser.go
58 lines (50 loc) · 1.66 KB
/
fake_parser.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
58
// This file was generated by counterfeiter
package fakes
import (
"sync"
"github.com/cloudfoundry/bosh-cli/deployment/manifest"
bidepltpl "github.com/cloudfoundry/bosh-cli/deployment/template"
)
type FakeParser struct {
ParseStub func(interpolatedTemplate bidepltpl.InterpolatedTemplate, path string) (manifest.Manifest, error)
parseMutex sync.RWMutex
parseArgsForCall []struct {
interpolatedTemplate bidepltpl.InterpolatedTemplate
path string
}
parseReturns struct {
result1 manifest.Manifest
result2 error
}
}
func (fake *FakeParser) Parse(interpolatedTemplate bidepltpl.InterpolatedTemplate, path string) (manifest.Manifest, error) {
fake.parseMutex.Lock()
fake.parseArgsForCall = append(fake.parseArgsForCall, struct {
interpolatedTemplate bidepltpl.InterpolatedTemplate
path string
}{interpolatedTemplate, path})
fake.parseMutex.Unlock()
if fake.ParseStub != nil {
return fake.ParseStub(interpolatedTemplate, path)
} else {
return fake.parseReturns.result1, fake.parseReturns.result2
}
}
func (fake *FakeParser) ParseCallCount() int {
fake.parseMutex.RLock()
defer fake.parseMutex.RUnlock()
return len(fake.parseArgsForCall)
}
func (fake *FakeParser) ParseArgsForCall(i int) (bidepltpl.InterpolatedTemplate, string) {
fake.parseMutex.RLock()
defer fake.parseMutex.RUnlock()
return fake.parseArgsForCall[i].interpolatedTemplate, fake.parseArgsForCall[i].path
}
func (fake *FakeParser) ParseReturns(result1 manifest.Manifest, result2 error) {
fake.ParseStub = nil
fake.parseReturns = struct {
result1 manifest.Manifest
result2 error
}{result1, result2}
}
var _ manifest.Parser = new(FakeParser)