summaryrefslogtreecommitdiff
path: root/state_test.go
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-01-23 19:51:15 -0500
committerWolfy-J <[email protected]>2018-01-23 19:51:15 -0500
commit78a42de837928cf7d10a1ae04d7e82e56d66e1e2 (patch)
tree8882b9a051bcc9c42328df583c0bb8c39a89591e /state_test.go
parentfa4bd78d9f7c5f74e8445374370927c742fc4e78 (diff)
API update
Diffstat (limited to 'state_test.go')
-rw-r--r--state_test.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/state_test.go b/state_test.go
new file mode 100644
index 00000000..965ba6b6
--- /dev/null
+++ b/state_test.go
@@ -0,0 +1,21 @@
+package roadrunner
+
+import (
+ "github.com/stretchr/testify/assert"
+ "testing"
+)
+
+func Test_NewState(t *testing.T) {
+ st := newState(StateErrored)
+
+ assert.Equal(t, "errored", st.String())
+ assert.NotEqual(t, 0, st.Updated().Unix())
+}
+
+func Test_IsActive(t *testing.T) {
+ assert.False(t, newState(StateInactive).IsActive())
+ assert.True(t, newState(StateReady).IsActive())
+ assert.True(t, newState(StateWorking).IsActive())
+ assert.False(t, newState(StateStopped).IsActive())
+ assert.False(t, newState(StateErrored).IsActive())
+}