testutil

package
v0.4.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package testutil contains test utilities for krew.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type P

type P struct {
	// contains filtered or unexported fields
}

func NewPlugin

func NewPlugin() *P

NewPlugin builds a index.Plugin that is valid.

func (*P) V

func (p *P) V() index.Plugin

func (*P) WithName

func (p *P) WithName(s string) *P

func (*P) WithPlatforms

func (p *P) WithPlatforms(v ...index.Platform) *P

func (*P) WithShortDescription

func (p *P) WithShortDescription(v string) *P

func (*P) WithTypeMeta

func (p *P) WithTypeMeta(v metav1.TypeMeta) *P

func (*P) WithVersion

func (p *P) WithVersion(v string) *P

type R

type R struct {
	// contains filtered or unexported fields
}

func NewPlatform

func NewPlatform() *R

func (*R) V

func (p *R) V() index.Platform

func (*R) WithBin

func (p *R) WithBin(v string) *R

func (*R) WithFiles

func (p *R) WithFiles(v []index.FileOperation) *R

func (*R) WithOS

func (p *R) WithOS(os string) *R

func (*R) WithOSArch

func (p *R) WithOSArch(os, arch string) *R

func (*R) WithOSes

func (p *R) WithOSes(os ...string) *R

func (*R) WithSHA256

func (p *R) WithSHA256(v string) *R

func (*R) WithSelector

func (p *R) WithSelector(v *metav1.LabelSelector) *R

func (*R) WithURI

func (p *R) WithURI(v string) *R

type Receipt added in v0.4.0

type Receipt struct {
	// contains filtered or unexported fields
}

func NewReceipt added in v0.4.0

func NewReceipt() *Receipt

NewReceipt builds an index.Receipt that is valid.

func (*Receipt) V added in v0.4.0

func (r *Receipt) V() index.Receipt

func (*Receipt) WithPlugin added in v0.4.0

func (r *Receipt) WithPlugin(p index.Plugin) *Receipt

func (*Receipt) WithStatus added in v0.4.0

func (r *Receipt) WithStatus(s index.ReceiptStatus) *Receipt

type TempDir

type TempDir struct {
	// contains filtered or unexported fields
}

func NewTempDir

func NewTempDir(t *testing.T) *TempDir

NewTempDir creates a temporary directory which is automatically cleaned up when the test exits.

func (*TempDir) InitEmptyGitRepo added in v0.4.0

func (td *TempDir) InitEmptyGitRepo(path, url string)

func (*TempDir) Path

func (td *TempDir) Path(file string) string

Path returns the path to a file in the temp directory. The input file is expected to use '/' as directory separator regardless of the host OS.

func (*TempDir) Root

func (td *TempDir) Root() string

Root returns the root of the temporary directory.

func (*TempDir) Write

func (td *TempDir) Write(file string, content []byte) *TempDir

Write creates a file containing content in the temporary directory.

func (*TempDir) WriteYAML added in v0.4.0

func (td *TempDir) WriteYAML(file string, obj interface{}) *TempDir

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL