From 8ee97d72cd56ac12fac55d5cb0c8391a6f85e96d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Fri, 1 Nov 2019 23:20:15 +0100 Subject: [PATCH] Extract outputStub into `testing.go` --- command/pr_test.go | 12 ------------ command/testing.go | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 12 deletions(-) create mode 100644 command/testing.go diff --git a/command/pr_test.go b/command/pr_test.go index 88eb6f2a8..6d5bf8869 100644 --- a/command/pr_test.go +++ b/command/pr_test.go @@ -89,18 +89,6 @@ func TestPRView(t *testing.T) { } } -type outputStub struct { - contents []byte -} - -func (s outputStub) Output() ([]byte, error) { - return s.contents, nil -} - -func (s outputStub) Run() error { - return nil -} - func TestPRView_NoActiveBranch(t *testing.T) { initBlankContext("OWNER/REPO", "master") http := initFakeHTTP() diff --git a/command/testing.go b/command/testing.go new file mode 100644 index 000000000..3d7284d23 --- /dev/null +++ b/command/testing.go @@ -0,0 +1,14 @@ +package command + +// outputStub implements a simple utils.Runnable +type outputStub struct { + output []byte +} + +func (s outputStub) Output() ([]byte, error) { + return s.output, nil +} + +func (s outputStub) Run() error { + return nil +}