Merge pull request #304 from osocurioso/silence-tests

test: avoid output from "go test" when tests pass
This commit is contained in:
Jesse Szwedko 2015-12-12 17:25:10 -05:00
commit a3c75bc94e
2 changed files with 4 additions and 0 deletions

View File

@ -5,6 +5,7 @@ import (
"flag" "flag"
"fmt" "fmt"
"io" "io"
"io/ioutil"
"os" "os"
"strings" "strings"
"testing" "testing"
@ -556,6 +557,7 @@ func TestAppNoHelpFlag(t *testing.T) {
HelpFlag = BoolFlag{} HelpFlag = BoolFlag{}
app := NewApp() app := NewApp()
app.Writer = ioutil.Discard
err := app.Run([]string{"test", "-h"}) err := app.Run([]string{"test", "-h"})
if err != flag.ErrHelp { if err != flag.ErrHelp {

View File

@ -3,6 +3,7 @@ package cli
import ( import (
"errors" "errors"
"flag" "flag"
"io/ioutil"
"testing" "testing"
) )
@ -20,6 +21,7 @@ func TestCommandFlagParsing(t *testing.T) {
for _, c := range cases { for _, c := range cases {
app := NewApp() app := NewApp()
app.Writer = ioutil.Discard
set := flag.NewFlagSet("test", 0) set := flag.NewFlagSet("test", 0)
set.Parse(c.testArgs) set.Parse(c.testArgs)