Merge pull request #304 from osocurioso/silence-tests
test: avoid output from "go test" when tests pass
This commit is contained in:
commit
a3c75bc94e
@ -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 {
|
||||
|
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user