txst

package module
v0.0.0-...-2e87e6a Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2016 License: MIT Imports: 12 Imported by: 0

README

Flotilla Build Status GoDoc Coverage Status license

A basic & extensible set of libraries for building internet applications in go.

Flotilla can be installed with

go get -u github.com/thrisp/flotilla.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var METHODS []string = []string{"GET", "POST", "PATCH", "DELETE", "PUT", "OPTIONS", "HEAD"}

Functions

func NewExpectation

func NewExpectation(code int, method, path string, ts ...Tanage) (*expectation, error)

func NoTanage

func NoTanage(code int, method, path string) (*expectation, error)

func NotFoundExpectation

func NotFoundExpectation(method, path string, ts ...Tanage) (*expectation, error)

func TxstingApp

func TxstingApp(t *testing.T, name string, conf ...app.Config) *app.App

func VerboseTxstingApp

func VerboseTxstingApp(t *testing.T, name string, conf ...app.Config) *app.App

Types

type Expectation

type Expectation interface {
	Register(*testing.T, TxstApp)
	SetPreRegister(bool)
	SetPre(...func(*testing.T, *http.Request))
	SetPost(...func(*testing.T, *httptest.ResponseRecorder))
	Request() *http.Request
	Response() *httptest.ResponseRecorder
	Run(*testing.T, TxstApp)
	Tanagers(...Tanage) []Tanage
}

type Performer

type Performer interface {
	Register(*testing.T, TxstApp, ...Expectation)
	Perform()
	Expectations(...Expectation) []Expectation
}

func MultiPerformer

func MultiPerformer(t *testing.T, a TxstApp, es ...Expectation) Performer

MultiPerformer is a Performer for any number of Expectations.

func SessionPerformer

func SessionPerformer(t *testing.T, a TxstApp, es ...Expectation) Performer

SessionPerformer is a Performer for any number of Expectations using the same session.

func SimplePerformer

func SimplePerformer(t *testing.T, a TxstApp, es ...Expectation) Performer

SimplePerformer is a Performer for a maximum of one Expectation.

func ZeroExpectationPerformer

func ZeroExpectationPerformer(t *testing.T, a TxstApp, code int, method, path string) Performer

ZeroExpectationPerformer is a Performer using no Expectations.

type Tanage

type Tanage func(*testing.T) state.Manage

type TxstApp

type TxstApp interface {
	Manage(*route.Route)
	ServeHTTP(http.ResponseWriter, *http.Request)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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