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"
|
"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 {
|
||||||
|
@ -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)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user