Documentation ¶
Index ¶
- func BeASymlink(target string) types.GomegaMatcher
- func CopyDirectory(t *testing.T, source string, destination string)
- func CopyFile(t *testing.T, source string, destination string)
- func CopySymlink(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 HaveAppendSharedEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
- func HaveApplicationMetadata(expected layers.Metadata) types.GomegaMatcher
- func HaveArchiveEntry(expected string) types.GomegaMatcher
- func HaveContent(expected string) types.GomegaMatcher
- func HaveDefaultBuildEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
- func HaveDefaultLaunchEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
- func HaveDefaultSharedEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
- func HaveDelimiterBuildEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
- func HaveDelimiterLaunchEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
- func HaveDelimiterSharedEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
- func HaveLayerMetadata(build bool, cache bool, launch bool) types.GomegaMatcher
- func HaveLayerVersion(version string) 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 HavePersistentMetadata(expected interface{}) types.GomegaMatcher
- func HavePlans(plans ...buildplan.Plan) types.GomegaMatcher
- func HavePrependBuildEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
- func HavePrependLaunchEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
- func HavePrependPathBuildEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
- func HavePrependPathLaunchEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
- func HavePrependPathSharedEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
- func HavePrependSharedEnvironment(name string, format string, args ...interface{}) 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, ...)
- func WriteSymlink(t *testing.T, oldName string, newName string)
- type BuildFactory
- func (f *BuildFactory) AddDependency(id string, fixturePath string)
- func (f *BuildFactory) AddDependencyWithDependency(dependency buildpack.Dependency, fixturePath string)
- func (f *BuildFactory) AddDependencyWithVersion(id string, version string, fixturePath string)
- func (f *BuildFactory) AddPlan(plan buildpackplan.Plan)
- func (f *BuildFactory) AddService(name string, credentials services.Credentials, tags ...string)
- func (f *BuildFactory) SetDefaultVersion(id, version string)
- type Command
- type DetectFactory
- type Runner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BeASymlink ¶
func BeASymlink(target string) types.GomegaMatcher
BeASymlink asserts that a file is a symlink and the link points to a given target.
func CopyDirectory ¶
CopyDirectory copies source to destination recursively.
func CopyFile ¶
CopyFile copies source to destination. Before writing, it creates all required parent directories for the destination.
func CopySymlink ¶
CopySymlink copies source to destination. Before writing, it creates all required parent directories for the destination.
func HaveAppendBuildEnvironment ¶
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 ¶
func HaveAppendLaunchEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
HaveAppendLaunchEnvironment tests that a layer has an append launch environment variable with the expected content.
func HaveAppendSharedEnvironment ¶
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 HaveApplicationMetadata ¶
func HaveApplicationMetadata(expected layers.Metadata) types.GomegaMatcher
HaveApplicationMetadata tests that an application metadata has expected content.
func HaveArchiveEntry ¶
func HaveArchiveEntry(expected string) types.GomegaMatcher
HaveContent tests that a file has expected content.
func HaveContent ¶
func HaveContent(expected string) types.GomegaMatcher
HaveContent tests that a file has expected content.
func HaveDefaultBuildEnvironment ¶
func HaveDefaultBuildEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
HaveDefaultBuildEnvironment tests that a layer has a default build environment variable with the expected content.
func HaveDefaultLaunchEnvironment ¶
func HaveDefaultLaunchEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
HaveDefaultLaunchEnvironment tests that a layer has a default launch environment variable with the expected content.
func HaveDefaultSharedEnvironment ¶
func HaveDefaultSharedEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
HaveDefaultSharedEnvironment tests that a layer has a default shared environment variable with the expected content.
func HaveDelimiterBuildEnvironment ¶
func HaveDelimiterBuildEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
HaveDelimiterBuildEnvironment tests that a layer has a delimiter for a build environment variable with the expected content.
func HaveDelimiterLaunchEnvironment ¶
func HaveDelimiterLaunchEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
HaveDelimiterLaunchEnvironment tests that a layer has a delimiter for a launch environment variable with the expected content.
func HaveDelimiterSharedEnvironment ¶
func HaveDelimiterSharedEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
HaveDelimiterSharedEnvironment tests that a layer has a delimiter for a shared environment variable with the expected content.
func HaveLayerMetadata ¶
func HaveLayerMetadata(build bool, cache bool, launch bool) types.GomegaMatcher
HaveLayerMetadata tests that a layer has a specific metadata configuration.
func HaveLayerVersion ¶
func HaveLayerVersion(version string) types.GomegaMatcher
HaveLayerVersion tests that a layer has a specific version.
func HaveOverrideBuildEnvironment ¶
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 ¶
func HaveOverrideLaunchEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
HaveOverrideLaunchEnvironment tests that a layer has an override launch environment variable with the expected content.
func HaveOverrideSharedEnvironment ¶
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 ¶
func HavePermissions(expected os.FileMode) types.GomegaMatcher
func HavePersistentMetadata ¶
func HavePersistentMetadata(expected interface{}) types.GomegaMatcher
HavePersistentMetadata tests that an persistent metadata has expected content.
func HavePlans ¶
func HavePlans(plans ...buildplan.Plan) types.GomegaMatcher
HavePlans tests that a set of plans is returned from detect.
func HavePrependBuildEnvironment ¶
func HavePrependBuildEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
HavePrependBuildEnvironment tests that a layer has a prepend build environment variable with the expected content.
func HavePrependLaunchEnvironment ¶
func HavePrependLaunchEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
HavePrependLaunchEnvironment tests that a layer has a prepend launch environment variable with the expected content.
func HavePrependPathBuildEnvironment ¶
func HavePrependPathBuildEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
HavePrependPathBuildEnvironment tests that a layer has a prepend path build environment variable with the expected content.
func HavePrependPathLaunchEnvironment ¶
func HavePrependPathLaunchEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
HavePrependPathLaunchEnvironment tests that a layer has a prepend path launch environment variable with the expected content.
func HavePrependPathSharedEnvironment ¶
func HavePrependPathSharedEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
HavePrependPathSharedEnvironment tests that a layer has a prepend path shared environment variable with the expected content.
func HavePrependSharedEnvironment ¶
func HavePrependSharedEnvironment(name string, format string, args ...interface{}) types.GomegaMatcher
HavePrependSharedEnvironment tests that a layer has a prepend shared environment variable with the expected content.
func HaveProfile ¶
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 ¶
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 ¶
ScratchDir returns a safe scratch directory for tests to modify.
func WriteFileFromReader ¶
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 // Plans is the buildpack plans at termination. Plans buildpackplan.Plans // Runner is the used to capture commands executed outside the process. Runner *Runner // 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) 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) AddDependencyWithDependency ¶
func (f *BuildFactory) AddDependencyWithDependency(dependency buildpack.Dependency, fixturePath string)
AddDependencyWithVersion adds a dependency to the buildpack metadata and copies a fixture into a cached dependency layer
func (*BuildFactory) AddDependencyWithVersion ¶
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) AddPlan ¶
func (f *BuildFactory) AddPlan(plan buildpackplan.Plan)
AddPlan adds a plan to the Plans.
func (*BuildFactory) AddService ¶
func (f *BuildFactory) AddService(name string, credentials services.Credentials, tags ...string)
AddService adds an entry to the collection of services.
func (*BuildFactory) SetDefaultVersion ¶
func (f *BuildFactory) SetDefaultVersion(id, version string)
SetDefaultVersion sets a default dependency version in the buildpack metadata
type DetectFactory ¶
type DetectFactory struct { // Detect is the configured detect to use. Detect detect.Detect // Home is the home directory to use. Home string // Plans is the build plans at termination. Plans buildplan.Plans // Runner is the used to capture commands executed outside the process. Runner *Runner // 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) AddService ¶
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_directory.go
- copy_file.go
- copy_symlink.go
- have_application_metadata.go
- have_archive_entry.go
- have_content.go
- have_environment.go
- have_layer_metadata.go
- have_layer_version.go
- have_permissions.go
- have_persistent_metadata.go
- have_plans.go
- have_profile.go
- replace_env.go
- runner.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
- write_symlink.go