fixtures

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(t *testing.T, r io.Reader, into interface{})

Decode decodes the reader into into the passed value, or fails the test if unable to

func Marshal

func Marshal(t *testing.T, payload interface{}) *bytes.Buffer

Marshal unmarshalls the payload and returns a *bytes.Buffer with the content, or fails the test if unable to

func MarshalBytes

func MarshalBytes(t *testing.T, payload interface{}) []byte

MarshalBytes unmarshals the payload and returns a []byte with the content, or fails the test if unable to

Types

type ServerBuilder

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

func NewTestServer

func NewTestServer(t *testing.T) ServerBuilder

func (ServerBuilder) Build

func (s ServerBuilder) Build() *httptest.Server

func (ServerBuilder) Data

func (s ServerBuilder) Data(data interface{}) ServerBuilder

func (ServerBuilder) Method

func (s ServerBuilder) Method(method string) ServerBuilder

func (ServerBuilder) Path

func (s ServerBuilder) Path(path string) ServerBuilder

func (ServerBuilder) Query

func (s ServerBuilder) Query(query string) ServerBuilder

func (ServerBuilder) Return

func (s ServerBuilder) Return(responseCode int) ServerBuilder

func (ServerBuilder) Token

func (s ServerBuilder) Token(token string) ServerBuilder

Jump to

Keyboard shortcuts

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