Skip to content
Permalink
Browse files

Back out the testify/assert addition 😅

  • Loading branch information
meatballhat committed Aug 4, 2017
1 parent 47a4123 commit df5c6caa961b1ecd16a08bf5eb7961946477cf2a
Showing with 7 additions and 11 deletions.
  1. +5 −7 app_test.go
  2. +2 −4 errors_test.go
@@ -11,8 +11,6 @@ import (
"reflect"
"strings"
"testing"

"github.com/stretchr/testify/assert"
)

var (
@@ -276,10 +274,10 @@ func TestApp_Run(t *testing.T) {
}

err := app.Run([]string{"command", "foo"})
assert.Nil(t, err)
expect(t, err, nil)
err = app.Run([]string{"command", "bar"})
assert.Nil(t, err)
assert.Equal(t, "foobar", s)
expect(t, err, nil)
expect(t, s, "foobar")
}

var commandAppTests = []struct {
@@ -333,8 +331,8 @@ func TestApp_CommandWithArgBeforeFlags(t *testing.T) {
}
app.Run([]string{"", "cmd", "my-arg", "--option", "my-option"})

assert.Equal(t, parsedOption, "my-option")
assert.Equal(t, firstArg, "my-arg")
expect(t, parsedOption, "my-option")
expect(t, firstArg, "my-arg")
}

func TestApp_RunAsSubcommandParseFlags(t *testing.T) {
@@ -5,8 +5,6 @@ import (
"errors"
"fmt"
"testing"

"github.com/stretchr/testify/assert"
)

func TestHandleExitCoder_nil(t *testing.T) {
@@ -119,6 +117,6 @@ func TestHandleExitCoder_MultiErrorWithFormat(t *testing.T) {
err := newMultiError(NewErrorWithFormat("err1"), NewErrorWithFormat("err2"))
HandleExitCoder(err)

assert.True(t, called)
assert.Equal(t, "This the format: err1\nThis the format: err2\n", ErrWriter.(*bytes.Buffer).String())
expect(t, called, true)
expect(t, ErrWriter.(*bytes.Buffer).String(), "This the format: err1\nThis the format: err2\n")
}

0 comments on commit df5c6ca

Please sign in to comment.
You can’t perform that action at this time.