Use akyoto/assert for tests

This commit is contained in:
2019-08-25 15:41:59 +09:00
parent 8ff4e010fb
commit 3d89d2787a
12 changed files with 54 additions and 63 deletions

View File

@ -1,18 +1,17 @@
package arn_test
import (
"strings"
"testing"
"github.com/akyoto/assert"
"github.com/animenotifier/notify.moe/arn"
"github.com/stretchr/testify/assert"
)
func TestNewUser(t *testing.T) {
user := arn.NewUser()
assert.NotNil(t, user)
assert.NotEmpty(t, user.ID)
assert.NotEqual(t, user.ID, "")
}
func TestDatabaseErrorMessages(t *testing.T) {
@ -20,6 +19,5 @@ func TestDatabaseErrorMessages(t *testing.T) {
// We need to make sure that non-existent records return "not found" in the error message.
assert.NotNil(t, err)
assert.NotEmpty(t, err.Error())
assert.NotEqual(t, -1, strings.Index(err.Error(), "not found"))
assert.Contains(t, err.Error(), "not found")
}