Back out the testify/assert addition 😅
This commit is contained in:
parent
47a412375f
commit
df5c6caa96
12
app_test.go
12
app_test.go
@ -11,8 +11,6 @@ import (
|
|||||||
"reflect"
|
"reflect"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -276,10 +274,10 @@ func TestApp_Run(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
err := app.Run([]string{"command", "foo"})
|
err := app.Run([]string{"command", "foo"})
|
||||||
assert.Nil(t, err)
|
expect(t, err, nil)
|
||||||
err = app.Run([]string{"command", "bar"})
|
err = app.Run([]string{"command", "bar"})
|
||||||
assert.Nil(t, err)
|
expect(t, err, nil)
|
||||||
assert.Equal(t, "foobar", s)
|
expect(t, s, "foobar")
|
||||||
}
|
}
|
||||||
|
|
||||||
var commandAppTests = []struct {
|
var commandAppTests = []struct {
|
||||||
@ -333,8 +331,8 @@ func TestApp_CommandWithArgBeforeFlags(t *testing.T) {
|
|||||||
}
|
}
|
||||||
app.Run([]string{"", "cmd", "my-arg", "--option", "my-option"})
|
app.Run([]string{"", "cmd", "my-arg", "--option", "my-option"})
|
||||||
|
|
||||||
assert.Equal(t, parsedOption, "my-option")
|
expect(t, parsedOption, "my-option")
|
||||||
assert.Equal(t, firstArg, "my-arg")
|
expect(t, firstArg, "my-arg")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestApp_RunAsSubcommandParseFlags(t *testing.T) {
|
func TestApp_RunAsSubcommandParseFlags(t *testing.T) {
|
||||||
|
@ -5,8 +5,6 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestHandleExitCoder_nil(t *testing.T) {
|
func TestHandleExitCoder_nil(t *testing.T) {
|
||||||
@ -119,6 +117,6 @@ func TestHandleExitCoder_MultiErrorWithFormat(t *testing.T) {
|
|||||||
err := newMultiError(NewErrorWithFormat("err1"), NewErrorWithFormat("err2"))
|
err := newMultiError(NewErrorWithFormat("err1"), NewErrorWithFormat("err2"))
|
||||||
HandleExitCoder(err)
|
HandleExitCoder(err)
|
||||||
|
|
||||||
assert.True(t, called)
|
expect(t, called, true)
|
||||||
assert.Equal(t, "This the format: err1\nThis the format: err2\n", ErrWriter.(*bytes.Buffer).String())
|
expect(t, ErrWriter.(*bytes.Buffer).String(), "This the format: err1\nThis the format: err2\n")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user