summaryrefslogtreecommitdiffstats
path: root/test/version_test.go
diff options
context:
space:
mode:
authorClément Bénier <clement.benier@iot.bzh>2018-10-23 15:09:06 +0200
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2018-10-24 10:43:37 +0000
commita740425411f120ff7263f16f268e7efd7c19b311 (patch)
tree4ef142dfb4b5c57648e4e00243a234b2ad31f086 /test/version_test.go
parent3e3222406a6f015a9fee3720e8ba76ecf58b087f (diff)
testify: assert replace by require
require handles tests to be aborted during an assertion contrary to assert Change-Id: I3062046515c74509ae7ea1b24b7242a42d0191c1 Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
Diffstat (limited to 'test/version_test.go')
-rw-r--r--test/version_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/version_test.go b/test/version_test.go
index 5373a15..dab77ad 100644
--- a/test/version_test.go
+++ b/test/version_test.go
@@ -20,17 +20,17 @@ import (
"regexp"
"testing"
- "github.com/stretchr/testify/assert"
+ "github.com/stretchr/testify/require"
)
func TestVersion(t *testing.T) {
var datVersion map[string]interface{}
- assert.Nil(t, HTTPCli.Get("/version", &datVersion))
+ require.Nil(t, HTTPCli.Get("/version", &datVersion))
Debug(t, datVersion)
ver, present := datVersion["version"]
- assert.True(t, present)
+ require.True(t, present)
Debugf(t, "version is %s", ver.(string))
re := regexp.MustCompile("^v*[0-9]+.[0-9]+.[0-9]+$")
- assert.True(t, re.MatchString(ver.(string)))
+ require.True(t, re.MatchString(ver.(string)))
}