testutil

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package testutil contains utility methods for use in tests

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Matches

func Matches(t *testing.T, exp interface{}) gomock.Matcher

Matches returns a generic gomock.Matcher implementation for a value.

func WithFTPServer added in v1.7.0

func WithFTPServer(t *testing.T) *ftp.Conn

WithFTPServer is a test helper function that creates a connection to an FTP server configured by the environment.

func WithPostgresInstance

func WithPostgresInstance(t *testing.T, migrations *database.MigrationSource) *sql.DB

WithPostgresInstance is a test helper function that creates a connection to a postgres database configured by the environment. Once connected, migrations are performed. When the test is finished, the database will be migrated down again.

func WithSQLiteInstance

func WithSQLiteInstance(t *testing.T, migrations *database.MigrationSource) *sql.DB

WithSQLiteInstance is a test helper function that creates an sqlite database. Once connected, migrations are performed. When the test is finished, the database will be migrated down again.

Types

type Matcher

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

The Matcher type is a generic gomock.Matcher implementation for comparing two values.

func (*Matcher) Matches

func (m *Matcher) Matches(actual interface{}) bool

Matches returns true if the given value matches the expected one.

func (*Matcher) String

func (m *Matcher) String() string

Jump to

Keyboard shortcuts

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