From 7475cd260a3aba46e0b7524656b42209c1779c22 Mon Sep 17 00:00:00 2001 From: Jesse Hallam Date: Wed, 8 Aug 2018 06:07:38 -0400 Subject: fix plugintest example and docs (#9213) --- plugin/plugintest/plugintest.go | 48 ----------------------------------------- 1 file changed, 48 deletions(-) delete mode 100644 plugin/plugintest/plugintest.go (limited to 'plugin/plugintest/plugintest.go') diff --git a/plugin/plugintest/plugintest.go b/plugin/plugintest/plugintest.go deleted file mode 100644 index 0275edd84..000000000 --- a/plugin/plugintest/plugintest.go +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -// The plugintest package provides mocks that can be used to test plugins. For example, to test the -// ServeHTTP method of the plugin package's HelloUser example: -// -// package plugin_test -// -// import ( -// "io/ioutil" -// "net/http/httptest" -// "testing" -// -// "github.com/stretchr/testify/assert" -// "github.com/stretchr/testify/require" -// -// "github.com/mattermost/mattermost-server/model" -// "github.com/mattermost/mattermost-server/plugin/plugintest" -// ) -// -// func TestHelloUserPlugin(t *testing.T) { -// user := &model.User{ -// Id: model.NewId(), -// Username: "billybob", -// } -// -// api := &plugintest.API{} -// api.On("GetUser", user.Id).Return(user, nil) -// defer api.AssertExpectations(t) -// -// p := &HelloUserPlugin{} -// p.OnActivate(api) -// -// w := httptest.NewRecorder() -// r := httptest.NewRequest("GET", "/", nil) -// r.Header.Add("Mattermost-User-Id", user.Id) -// p.ServeHTTP(w, r) -// body, err := ioutil.ReadAll(w.Result().Body) -// require.NoError(t, err) -// assert.Equal(t, "Welcome back, billybob!", string(body)) -// } -// -// The mocks are created using testify's mock package: -// https://godoc.org/github.com/stretchr/testify/mock -// -// If you need to import the mock package, you can import it with -// "github.com/mattermost/mattermost-server/plugin/plugintest/mock". -package plugintest -- cgit v1.2.3-1-g7c22