Documentation ¶
Index ¶
- type DefaultFileResolver
- func (fr *DefaultFileResolver) Clone() FileResolver
- func (fr *DefaultFileResolver) ReplacePath(pathInTest, actualPath string) *DefaultFileResolver
- func (fr *DefaultFileResolver) ResolveAbsolutePath(value string) string
- func (fr *DefaultFileResolver) ResolveFileValue(value string) ([]byte, error)
- func (fr *DefaultFileResolver) SetContext(contextPath string)
- type FileResolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultFileResolver ¶
type DefaultFileResolver struct {
// contains filtered or unexported fields
}
DefaultFileResolver loads file contents for the test parser.
func NewDefaultFileResolver ¶
func NewDefaultFileResolver() *DefaultFileResolver
NewDefaultFileResolver yields a new DefaultFileResolver instance.
func (*DefaultFileResolver) Clone ¶
func (fr *DefaultFileResolver) Clone() FileResolver
Clone creates new instance of the same type.
func (*DefaultFileResolver) ReplacePath ¶
func (fr *DefaultFileResolver) ReplacePath(pathInTest, actualPath string) *DefaultFileResolver
ReplacePath offers the possibility to swap a path with another withouot providing a new set of tests. It is very useful when testing multiple contracts against the same tests.
func (*DefaultFileResolver) ResolveAbsolutePath ¶
func (fr *DefaultFileResolver) ResolveAbsolutePath(value string) string
ResolveAbsolutePath yields absolute value based on context.
func (*DefaultFileResolver) ResolveFileValue ¶
func (fr *DefaultFileResolver) ResolveFileValue(value string) ([]byte, error)
ResolveFileValue converts a value prefixed with "file:" and replaces it with the file contents.
func (*DefaultFileResolver) SetContext ¶
func (fr *DefaultFileResolver) SetContext(contextPath string)
SetContext sets directory where the test runs, to help resolve relative paths.
type FileResolver ¶
type FileResolver interface { // Clone creates new instance of the same type. Clone() FileResolver // SetContext sets directory where the test runs, to help resolve relative paths. SetContext(contextPath string) // ResolveAbsolutePath yields absolute value based on context. ResolveAbsolutePath(value string) string // ResolveFileValue converts a value prefixed with "file:" and replaces it with the file contents. ResolveFileValue(value string) ([]byte, error) }
FileResolver resolves scenario values starting with "file:"