tests

package
v1.3.884 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2019 License: Apache-2.0 Imports: 23 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertEqualFileText

func AssertEqualFileText(t *testing.T, expectedFile string, actualFile string) error

func AssertFileContains

func AssertFileContains(t *testing.T, fileName string, containsText string)

AssertFileContains asserts that a given file exists and contains the given text

func AssertFileDoesNotContain added in v1.3.861

func AssertFileDoesNotContain(t *testing.T, fileName string, containsText string)

AssertFileDoesNotContain asserts that a given file exists and does not contain the given text

func AssertFileDoesNotExist

func AssertFileDoesNotExist(t *testing.T, fileName string) bool

AssertFileDoesNotExist asserts that the given file does not exist

func AssertFileExists

func AssertFileExists(t *testing.T, fileName string) bool

AssertFileExists asserts that the given file exists

func AssertFilesExist

func AssertFilesExist(t *testing.T, expected bool, paths ...string)

AssertFilesExist asserts that the list of file paths either exist or don't exist

func AssertLoadFileText

func AssertLoadFileText(t *testing.T, fileName string) (string, error)

AssertLoadFileText asserts that the given file name can be loaded and returns the string contents

func AssertTextFileContentsEqual

func AssertTextFileContentsEqual(t *testing.T, expectedFile string, actualFile string)

AssertTextFileContentsEqual asserts that both the expected and actual files can be loaded as text and that their contents are identical

func CreateAuthConfigService

func CreateAuthConfigService() auth.ConfigService

CreateAuthConfigService creates and returns a fixture ConfigService

func Debugf

func Debugf(message string, args ...interface{})

Debugf debug format

func ExpectString

func ExpectString(t *testing.T, console *expect.Console, s string)

ExpectString does the same as the go-expect console.ExpectString method, but also reports failures to the testing object in a sensible format

func IsDebugLog

func IsDebugLog() bool

IsDebugLog debug log?

func Output

func Output() terminal.FileWriter

Output returns the output to use for tests

func SkipForWindows

func SkipForWindows(t *testing.T, reason string)

SkipForWindows skips tests if they are running on Windows This is to be used for valid tests that just don't work on windows for whatever reason

func TestCloser

func TestCloser(t *testing.T, closer io.Closer)

TestCloser closes io

func TestShouldDisableMaven

func TestShouldDisableMaven() bool

TestShouldDisableMaven should disable maven

Types

type ConsoleWrapper

type ConsoleWrapper struct {
	terminal.Stdio
	// contains filtered or unexported fields
}

ConsoleWrapper is a wrapper around the go-expect Console that takes a test object and will report failures This prevents users having to manually detect and report errors during the tests

func NewTerminal

func NewTerminal(t *testing.T) *ConsoleWrapper

NewTerminal mock terminal to control stdin and stdout

func (*ConsoleWrapper) Close

func (c *ConsoleWrapper) Close() error

Close closes the console

func (*ConsoleWrapper) CurrentState

func (c *ConsoleWrapper) CurrentState() string

CurrentState gets the last line of text currently on the console

func (*ConsoleWrapper) ExpectEOF

func (c *ConsoleWrapper) ExpectEOF()

ExpectEOF expects an EOF to be present on the console and reports an error if it is not

func (*ConsoleWrapper) ExpectString

func (c *ConsoleWrapper) ExpectString(s string)

ExpectString expects a string to be present on the console and fails the test if it is not

func (*ConsoleWrapper) SendLine

func (c *ConsoleWrapper) SendLine(s string)

SendLine sends a string to the console and fails the test if something goes wrong

Jump to

Keyboard shortcuts

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