gounit

package module
v0.0.0-...-f0a8ad0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2014 License: MIT Imports: 2 Imported by: 4

README

gounit

Go unit test enhancements that comes from JUnit's TestRule concept.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AfterSuite

func AfterSuite(t *testing.T)

func BeforeSuite

func BeforeSuite(t *testing.T)

func ClassRuleChain

func ClassRuleChain(rule ClassTestRule) *_ClassRuleChain

func CloseAfterSuite

func CloseAfterSuite(closer func() error)

Registers a Closeable resource that shold be closed after the suite completes.

func Test

func Test(t *testing.T, f func(t *T))

func TestRuleChain

func TestRuleChain(rule TestRule) *_RuleChain

Types

type Assert

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

func (*Assert) Assert

func (t *Assert) Assert(ok bool)

func (*Assert) Verify

func (t *Assert) Verify(ok bool)

type ClassTestRule

type ClassTestRule interface {
	Before() error
	After() error
}

Workaround Junit's TestRule for class

type T

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

func It

func It(t *testing.T) *T

func (*T) Assert

func (c *T) Assert(ok bool)

func (*T) Assert2

func (c *T) Assert2(ok bool, msg string, args ...interface{})

func (*T) Error

func (c *T) Error(args ...interface{})

func (*T) Should

func (t *T) Should(msg string, args ...interface{}) *Assert

type TestRule

type TestRule interface {
	Apply(t *testing.T, f func(t *T)) func(t *T)
}

Mimic JUnit's TestRule

Jump to

Keyboard shortcuts

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