<commit_before>package controller_test

import (
	"github.com/golang/mock/gomock"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"

	"github.com/shijuvar/gokit/examples/testing/gomock/controller"
	"github.com/shijuvar/gokit/examples/testing/gomock/mocks"
)

var _ = Describe("Table", func() {

	var (
		mockCtrl       *gomock.Controller
		mockStore      *mocks.MockUserStore
		userController *controller.UserController
	)

	BeforeEach(func() {
		mockCtrl = gomock.NewController(GinkgoT())
		mockStore = mocks.NewMockUserStore(mockCtrl)
		userController = &controller.UserController{Store: mockStore}
	})

	AfterEach(func() {
		mockCtrl.Finish()
	})

	It("should consume things", func() {
		mockStore.EXPECT().AddUser("shijuvar").Return(nil).Times(1)
		err := userController.Create("shijuvar")
		Ω(err).Should(BeNil())

	})
})<commit_msg>Mocking with GoMock<commit_after>package controller_test

import (
	"github.com/golang/mock/gomock"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"

	"github.com/shijuvar/gokit/examples/testing/gomock/controller"
	"github.com/shijuvar/gokit/examples/testing/gomock/mocks"
)

var _ = Describe("Table", func() {

	var (
		mockCtrl       *gomock.Controller
		mockStore      *mocks.MockUserStore
		userController *controller.UserController
	)

	BeforeEach(func() {
		mockCtrl = gomock.NewController(GinkgoT())
		mockStore = mocks.NewMockUserStore(mockCtrl)
		userController = &controller.UserController{Store: mockStore}
	})

	AfterEach(func() {
		mockCtrl.Finish()
	})

	It("Add User", func() {
		mockStore.EXPECT().AddUser("shijuvar").Return(nil).Times(1)
		err := userController.Create("shijuvar")
		Ω(err).Should(BeNil())

	})
})
{'fraction_non_alphanumeric': 0.15110053539559787, 'fraction_numerical': 0.001189767995240928, 'mean_word_length': 4.72108843537415, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4148850', 'n_tokens_mistral': 646, 'n_tokens_neox': 609, 'n_words': 73}