Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
oglemock
✓ github.com/jacobsa/oglemock
Sets up a mock with an expectation and verifies the call.
package main
import (
"testing"
"github.com/jacobsa/oglemock"
"github.com/jacobsa/ogletest"
)
type MyInterface interface {
DoSomething(int) string
}
func TestMyFunction(t *testing.T) {
mockCtrl := oglemock.NewController(t)
defer mockCtrl.Finish()
mock := oglemock.NewMockMyInterface(mockCtrl, "")
// Set expectations
oglemock.ExpectCall(mock, "DoSomething")(1).WillOnce(oglemock.Return("result"))
// Use mock
result := mock.DoSomething(1)
ogletest.ExpectEq("result", result)
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
0.0.0-20150831005832-e94d794d06fflatest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.