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

View File

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