forked from keighl/barkup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rethinkdb_test.go
47 lines (38 loc) · 1015 Bytes
/
rethinkdb_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package barkup
import (
"strings"
"testing"
)
func Test_RethinkDB_Export_Pass(t *testing.T) {
m := RethinkDB{
Connection: "localhost:28015",
Name: "test",
}
RethinkCmd = "true"
result := m.Export()
expect(t, result.Error, (*Error)(nil))
}
func Test_RethinkDB_Export_FailDump(t *testing.T) {
m := RethinkDB{
Connection: "localhost:28015",
Name: "test",
}
RethinkCmd = "false"
result := m.Export()
refute(t, result.Error, (*Error)(nil))
}
func Test_RethinkDB_optionsDump(t *testing.T) {
m := RethinkDB{
Connection: "localhost:28015",
Name: "test",
Targets: []string{"cheese", "milk"},
Options: []string{"-aAUTHKEY"},
}
optionsR := m.dumpOptions()
expect(t, optionsR[0], "dump")
options := strings.Join(optionsR, " ")
expect(t, strings.Contains(options, "-clocalhost:28015"), true)
expect(t, strings.Contains(options, "-aAUTHKEY"), true)
expect(t, strings.Contains(options, "-echeese"), true)
expect(t, strings.Contains(options, "-emilk"), true)
}