mocking

package
v0.0.0-...-8fa270c Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2014 License: BSD-2-Clause-Views Imports: 4 Imported by: 0

Documentation

Overview

Package mocking makes testing Tiger Tonic services easier.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Header(h http.Header) http.Header

Header augments an optional existing http.Header with Accept and Content-Type headers as required by Tiger Tonic.

func URL

func URL(h TestableHandler, method, rawurl string) *url.URL

URL constructs a url.URL for use in tests and ensures it's routed by the given TestableHandler.

Types

type TestableHandler

type TestableHandler interface {
	Handler(*http.Request) (http.Handler, string)
}

TestableHandler wraps the Handler method from http.ServeMux to make it easier to detect in tests.

Jump to

Keyboard shortcuts

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