ginkgomock

package module
v0.0.0-...-134f8be Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2020 License: MIT Imports: 3 Imported by: 0

README

Ginkgo Mock

This package makes it easier to use mock with ginkgo.

var _ = ginkgomock.Describe("ControllerTest", func(c *ginkgomock.Context) { // note the context
  var controller *mocks.MockController

  BeforeEach(func() {
    controller = mocks.NewMockController(c.Controller())
  })

  // ...
})

There is no need to manage the lifecycle of the gomock.Controller. This is done automatically for you behind the scenes. The ginkgomock library wraps your Describe with an outer Describe which has BeforeEach and AfterEach blocks where the lifecycle of the mock controller is managed.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Describe

func Describe(text string, body func(*Context)) bool

Types

type Context

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

func (*Context) Context

func (c *Context) Context() context.Context

func (*Context) Controller

func (c *Context) Controller() *gomock.Controller

Directories

Path Synopsis
mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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