1
Fork 0

Use assert in legacy unit tests (#867)

This commit is contained in:
Ethan Koenig 2017-02-08 01:29:07 -05:00 committed by Lunny Xiao
parent 23a7527e04
commit d2329e1c26
69 changed files with 249 additions and 6983 deletions

View file

@ -7,17 +7,13 @@ package avatar
import (
"testing"
. "github.com/smartystreets/goconvey/convey"
"github.com/stretchr/testify/assert"
)
func Test_RandomImage(t *testing.T) {
Convey("Generate a random avatar from email", t, func() {
_, err := RandomImage([]byte("gogs@local"))
So(err, ShouldBeNil)
_, err := RandomImage([]byte("gogs@local"))
assert.NoError(t, err)
Convey("Try to generate an image with size zero", func() {
_, err := RandomImageSize(0, []byte("gogs@local"))
So(err, ShouldNotBeNil)
})
})
_, err = RandomImageSize(0, []byte("gogs@local"))
assert.Error(t, err)
}