testutils

package
v0.0.0-...-5a0bf87 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2016 License: Apache-2.0, MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RestHelper

type RestHelper struct{}

func (*RestHelper) Delete

func (h *RestHelper) Delete(t T, url string) scroll.Response

func (*RestHelper) Do

func (h *RestHelper) Do(t T, req *http.Request) scroll.Response

Do makes a given http.Request to the test server.

func (*RestHelper) Get

func (h *RestHelper) Get(t T, url string) scroll.Response

func (*RestHelper) Post

func (h *RestHelper) Post(t T, url string, data url.Values) scroll.Response

func (*RestHelper) PostJSON

func (h *RestHelper) PostJSON(t T, url, data string) scroll.Response

type T

type T interface {
	Fatal(args ...interface{})
}

T is an interface common to testing.T, testing.B, and *check.C.

type TestApp

type TestApp struct {
	RestHelper
	// contains filtered or unexported fields
}

TestApp wraps a regular app adding features that can be used in unit tests.

func NewTestApp

func NewTestApp() *TestApp

NewTestApp creates a new app should be used in unit tests.

func (*TestApp) Close

func (testApp *TestApp) Close()

Close shuts down the underlying test server.

func (*TestApp) GetApp

func (testApp *TestApp) GetApp() *scroll.App

GetApp returns an underlying "real" app for the test app.

func (*TestApp) GetURL

func (testApp *TestApp) GetURL() string

GetURL returns the base URL of the underlying test server.

Jump to

Keyboard shortcuts

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