barista.run: barista.run/testing/fail Index | Files

package fail

import "barista.run/testing/fail"

Package fail provides methods to test and verify failing assertions.

Index

Package Files

fail.go

func AssertFails Uses

func AssertFails(t *testing.T, fn func(*testing.T), formatAndArgs ...interface{})

AssertFails asserts that the given test function fails the test.

func Failed Uses

func Failed(fn func(*testing.T)) bool

Failed returns true if the given function failed the test.

type TestSetup Uses

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

TestSetup represents an already set up test environment, which provides a variant on AssertFails that fails the test as normal, but also fails the test if the setup function causes test failures.

func Setup Uses

func Setup(setupFn func(*testing.T)) *TestSetup

Setup shares the fake testing.T instance between a setup method and a test method, providing an AssertFails method that fails the test if the setup fails, or if the test method does not.

func (*TestSetup) AssertFails Uses

func (s *TestSetup) AssertFails(t *testing.T, fn func(*testing.T), formatAndArgs ...interface{})

AssertFails asserts that the given test function fails the test, and that the setup function used did not cause any test failures.

Package fail imports 2 packages (graph). Updated 2018-11-07. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).