testutils

package
v0.8.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2015 License: Apache-2.0, Apache-2.0 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) 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