summaryrefslogtreecommitdiff
path: root/ext/config_test.go
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-06-05 22:48:27 +0300
committerWolfy-J <[email protected]>2018-06-05 22:48:27 +0300
commit6adaf713b47c9a3ab3a516e21d2d4ecf7f2075d6 (patch)
tree6bcf1bfea1e2f87a3ae7065612c0df43c90c1cdc /ext/config_test.go
parent3112f9b58c73773cea972fd79f04d33f8f7d7edd (diff)
breaking the tests
Diffstat (limited to 'ext/config_test.go')
-rw-r--r--ext/config_test.go40
1 files changed, 40 insertions, 0 deletions
diff --git a/ext/config_test.go b/ext/config_test.go
new file mode 100644
index 00000000..fbdde223
--- /dev/null
+++ b/ext/config_test.go
@@ -0,0 +1,40 @@
+package ext
+
+import (
+ "github.com/stretchr/testify/assert"
+ "testing"
+ "time"
+)
+
+func Test_NumWorkers(t *testing.T) {
+ cfg := Config{
+ AllocateTimeout: time.Second,
+ DestroyTimeout: time.Second * 10,
+ }
+ err := cfg.Valid()
+
+ assert.NotNil(t, err)
+ assert.Equal(t, "cfg.NumWorkers must be set", err.Error())
+}
+
+func Test_AllocateTimeout(t *testing.T) {
+ cfg := Config{
+ NumWorkers: 10,
+ DestroyTimeout: time.Second * 10,
+ }
+ err := cfg.Valid()
+
+ assert.NotNil(t, err)
+ assert.Equal(t, "cfg.AllocateTimeout must be set", err.Error())
+}
+
+func Test_DestroyTimeout(t *testing.T) {
+ cfg := Config{
+ NumWorkers: 10,
+ AllocateTimeout: time.Second,
+ }
+ err := cfg.Valid()
+
+ assert.NotNil(t, err)
+ assert.Equal(t, "cfg.DestroyTimeout must be set", err.Error())
+}