25 lines
466 B
Go
25 lines
466 B
Go
|
package tests
|
||
|
|
||
|
import (
|
||
|
"kerma/models"
|
||
|
"testing"
|
||
|
|
||
|
. "github.com/smartystreets/goconvey/convey"
|
||
|
)
|
||
|
|
||
|
func TestError(t *testing.T) {
|
||
|
Convey("Given a new error", t, func() {
|
||
|
errString := "testing error"
|
||
|
var err models.Error
|
||
|
|
||
|
Convey("When the constructor is called with a value", func() {
|
||
|
err.Construct(errString)
|
||
|
|
||
|
Convey("The value should be set", func() {
|
||
|
So(err.Type, ShouldEqual, "error")
|
||
|
So(err.Error, ShouldEqual, errString)
|
||
|
})
|
||
|
})
|
||
|
})
|
||
|
}
|