runner

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2016 License: GPL-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package runner provides tools for running Silk tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseJSONBody

func ParseJSONBody(r io.Reader) (interface{}, error)

ParseJSONBody parses a JSON body.

Types

type Runner

type Runner struct {

	// RoundTripper is the transport to use when making requests.
	// By default it is http.DefaultTransport.
	RoundTripper http.RoundTripper
	// ParseBody is the function to use to attempt to parse
	// response bodies to make data avaialble for assertions.
	ParseBody func(r io.Reader) (interface{}, error)
	// Log is the function to log to.
	Log func(string)
	// Verbose is the function that logs verbose debug information.
	Verbose func(...interface{})
	// NewRequest makes a new http.Request. By default, uses http.NewRequest.
	NewRequest func(method, urlStr string, body io.Reader) (*http.Request, error)
	// contains filtered or unexported fields
}

Runner runs parsed tests.

func New

func New(t T, URL string) *Runner

New makes a new Runner with the given testing T target and the root URL.

func (*Runner) RunFile

func (r *Runner) RunFile(filenames ...string)

RunFile parses and runs the specified file(s).

func (*Runner) RunGlob

func (r *Runner) RunGlob(files []string, err error)

RunGlob is a helper that runs the files returned by filepath.Glob.

runner.RunGlob(filepath.Glob("pattern"))

func (*Runner) RunGroup

func (r *Runner) RunGroup(groups ...*parse.Group)

RunGroup runs a parse.Group. Consider RunFile instead.

type T

type T interface {
	FailNow()
	Log(...interface{})
}

T represents types to which failures may be reported. The testing.T type is one such example.

Jump to

Keyboard shortcuts

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