Extract outputStub into testing.go

This commit is contained in:
Mislav Marohnić 2019-11-01 23:20:15 +01:00
parent f6fcdf114e
commit 8ee97d72cd
2 changed files with 14 additions and 12 deletions

View file

@ -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()

14
command/testing.go Normal file
View file

@ -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
}