1package vars_test 2 3import ( 4 "testing" 5 6 . "github.com/onsi/ginkgo" 7 . "github.com/onsi/gomega" 8 9 . "github.com/concourse/concourse/vars" 10) 11 12func TestReg(t *testing.T) { 13 RegisterFailHandler(Fail) 14 RunSpecs(t, "director/template") 15} 16 17type FakeVariables struct { 18 GetFunc func(VariableDefinition) (interface{}, bool, error) 19 GetVarDef VariableDefinition 20 GetErr error 21 GetCallCount int 22} 23 24func (v *FakeVariables) Get(varDef VariableDefinition) (interface{}, bool, error) { 25 v.GetCallCount += 1 26 v.GetVarDef = varDef 27 if v.GetFunc != nil { 28 return v.GetFunc(varDef) 29 } 30 return nil, false, v.GetErr 31} 32 33func (v *FakeVariables) List() ([]VariableDefinition, error) { 34 return nil, nil 35} 36