Documentation ¶
Index ¶
- func BeASymlink(target string) types.GomegaMatcher
- func CopyFile(t *testing.T, source string, destination string)
- func HaveAppendBuildEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
- func HaveAppendLaunchEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
- func HaveAppendPathBuildEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
- func HaveAppendPathLaunchEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
- func HaveAppendPathSharedEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
- func HaveAppendSharedEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
- func HaveContent(expected string) types.GomegaMatcher
- func HaveLaunchMetadata(expected layers.Metadata) types.GomegaMatcher
- func HaveLayerMetadata(build bool, cache bool, launch bool) types.GomegaMatcher
- func HaveOverrideBuildEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
- func HaveOverrideLaunchEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
- func HaveOverrideSharedEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
- func HavePermissions(expected os.FileMode) types.GomegaMatcher
- func HaveProfile(name string, format string, args ...interface{}) types.GomegaMatcher
- func ReplaceEnv(t *testing.T, key string, value string) func()
- func ScratchDir(t *testing.T, prefix string) string
- func TouchFile(t *testing.T, elem ...string)
- func WriteFile(t *testing.T, filename string, format string, args ...interface{})
- func WriteFileFromReader(t *testing.T, filename string, perm os.FileMode, source io.Reader)
- func WriteFileWithPerm(t *testing.T, filename string, perm os.FileMode, format string, ...)
- type BuildFactory
- func (f *BuildFactory) AddBuildPlan(name string, dependency buildplan.Dependency)
- func (f *BuildFactory) AddDependency(id string, fixturePath string)
- func (f *BuildFactory) AddDependencyWithVersion(id string, version string, fixturePath string)
- func (f *BuildFactory) AddService(name string, credentials services.Credentials, tags ...string)
- type DetectFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BeASymlink ¶ added in v1.28.0
func BeASymlink(target string) types.GomegaMatcher
BeASymlink asserts that a file is a symlink and the link points to a given target.
func CopyFile ¶ added in v1.28.0
CopyFile copies source to destination. Before writing, it creates all required parent directories for the destination.
func HaveAppendBuildEnvironment ¶ added in v1.28.0
func HaveAppendBuildEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
HaveAppendBuildEnvironment tests that a layer has an append build environment variable with the expected content.
func HaveAppendLaunchEnvironment ¶ added in v1.28.0
func HaveAppendLaunchEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
HaveAppendBuildEnvironment tests that a layer has an append launch environment variable with the expected content.
func HaveAppendPathBuildEnvironment ¶ added in v1.28.0
func HaveAppendPathBuildEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
HaveAppendPathBuildEnvironment tests that a layer has an append path build environment variable with the expected content.
func HaveAppendPathLaunchEnvironment ¶ added in v1.28.0
func HaveAppendPathLaunchEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
HaveAppendPathBuildEnvironment tests that a layer has an append path launch environment variable with the expected content.
func HaveAppendPathSharedEnvironment ¶ added in v1.28.0
func HaveAppendPathSharedEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
HaveAppendPathSharedEnvironment tests that a layer has an append path shared environment variable with the expected content.
func HaveAppendSharedEnvironment ¶ added in v1.28.0
func HaveAppendSharedEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
HaveAppendSharedEnvironment tests that a layer has an append shared environment variable with the expected content.
func HaveContent ¶ added in v1.28.0
func HaveContent(expected string) types.GomegaMatcher
HaveContent tests that a file has expected content.
func HaveLaunchMetadata ¶ added in v1.28.0
func HaveLaunchMetadata(expected layers.Metadata) types.GomegaMatcher
HaveLaunchMetadata tests that a launch metadata has expected content.
func HaveLayerMetadata ¶ added in v1.28.0
func HaveLayerMetadata(build bool, cache bool, launch bool) types.GomegaMatcher
HaveLayerMetadata tests that a layer has a specific metadata configuration.
func HaveOverrideBuildEnvironment ¶ added in v1.28.0
func HaveOverrideBuildEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
HaveOverrideBuildEnvironment tests that a layer has an override build environment variable with the expected content.
func HaveOverrideLaunchEnvironment ¶ added in v1.28.0
func HaveOverrideLaunchEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
HaveOverrideBuildEnvironment tests that a layer has an override launch environment variable with the expected content.
func HaveOverrideSharedEnvironment ¶ added in v1.28.0
func HaveOverrideSharedEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
HaveOverrideSharedEnvironment tests that a layer has an override shared environment variable with the expected content.
func HavePermissions ¶ added in v1.28.0
func HavePermissions(expected os.FileMode) types.GomegaMatcher
func HaveProfile ¶ added in v1.28.0
func HaveProfile(name string, format string, args ...interface{}) types.GomegaMatcher
HaveProfile tests that a layer has a profile.d file with the expected content.
func ReplaceEnv ¶ added in v1.28.0
ReplaceEnv replaces an environment variable. Returns a function for use with defer in order to reset the previous value.
defer ReplaceEnv(t, "alpha", "bravo")()
func ScratchDir ¶ added in v1.32.0
ScratchDir returns a safe scratch directory for tests to modify.
func WriteFileFromReader ¶ added in v1.28.0
WriteFileFromReader writes a file with the given content from a io.Reader. Before writing, it creates all required parent directories for the file.
Types ¶
type BuildFactory ¶
type BuildFactory struct { // Build is the configured build to use. Build build.Build // Home is the home directory to use. Home string // Output is the BuildPlan output at termination. Output buildplan.BuildPlan // contains filtered or unexported fields }
BuildFactory is a factory for creating a test Build.
func NewBuildFactory ¶
func NewBuildFactory(t *testing.T) *BuildFactory
NewBuildFactory creates a new instance of BuildFactory.
func (*BuildFactory) AddBuildPlan ¶
func (f *BuildFactory) AddBuildPlan(name string, dependency buildplan.Dependency)
AddBuildPlan adds an entry to a build plan.
func (*BuildFactory) AddDependency ¶
func (f *BuildFactory) AddDependency(id string, fixturePath string)
AddDependency adds a dependency with version 1.0 to the buildpack metadata and copies a fixture into a cached dependency layer.
func (*BuildFactory) AddDependencyWithVersion ¶ added in v1.28.0
func (f *BuildFactory) AddDependencyWithVersion(id string, version string, fixturePath string)
AddDependencyWithVersion adds a dependency to the buildpack metadata and copies a fixture into a cached dependency layer
func (*BuildFactory) AddService ¶ added in v1.38.0
func (f *BuildFactory) AddService(name string, credentials services.Credentials, tags ...string)
AddService adds an entry to the collection of services.
type DetectFactory ¶
type DetectFactory struct { // Detect is the configured detect to use. Detect detect.Detect // Home is the home directory to use. Home string // Output is the BuildPlan output at termination. Output buildplan.BuildPlan // contains filtered or unexported fields }
DetectFactory is a factory for creating a test Detect.
func NewDetectFactory ¶
func NewDetectFactory(t *testing.T) *DetectFactory
NewDetectFactory creates a new instance of DetectFactory.
func (*DetectFactory) AddBuildPlan ¶
func (f *DetectFactory) AddBuildPlan(name string, dependency buildplan.Dependency)
AddBuildPlan adds an entry to a build plan.
func (*DetectFactory) AddService ¶ added in v1.38.0
func (f *DetectFactory) AddService(name string, credentials services.Credentials, tags ...string)
AddService adds an entry to the collection of services.
Source Files ¶
- be_a_symlink.go
- copy_file.go
- have_content.go
- have_environment.go
- have_launch_metadata.go
- have_layer_metadata.go
- have_permissions.go
- have_profile.go
- replace_env.go
- scratch_dir.go
- test_build_factory.go
- test_detect_factory.go
- touch_file.go
- write_file.go
- write_file_from_reader.go
- write_file_with_perm.go