arangorb 1.4.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ArangoRB.gemspec +20 -18
- data/Gemfile +3 -0
- data/README.md +1079 -908
- data/lib/AQL.rb +155 -0
- data/lib/Batch.rb +97 -0
- data/lib/Cache.rb +71 -0
- data/lib/Collection.rb +852 -0
- data/lib/Database.rb +417 -0
- data/lib/Document.rb +346 -0
- data/lib/Edge.rb +104 -0
- data/lib/Error.rb +125 -0
- data/lib/Foxx.rb +277 -0
- data/lib/Graph.rb +325 -0
- data/lib/Index.rb +126 -0
- data/lib/Replication.rb +235 -0
- data/lib/Request.rb +143 -0
- data/lib/Server.rb +466 -0
- data/lib/Task.rb +120 -0
- data/lib/Transaction.rb +115 -0
- data/lib/Traversal.rb +224 -0
- data/lib/User.rb +197 -0
- data/lib/Vertex.rb +127 -0
- data/lib/View.rb +151 -0
- data/lib/arangorb.rb +23 -15
- data/lib/helpers/Error.rb +28 -0
- data/lib/helpers/Return.rb +53 -0
- metadata +64 -45
- data/lib/ArangoRB_AQL.rb +0 -181
- data/lib/ArangoRB_Cache.rb +0 -174
- data/lib/ArangoRB_Col.rb +0 -526
- data/lib/ArangoRB_DB.rb +0 -363
- data/lib/ArangoRB_Doc.rb +0 -319
- data/lib/ArangoRB_Edg.rb +0 -184
- data/lib/ArangoRB_Gra.rb +0 -201
- data/lib/ArangoRB_Index.rb +0 -135
- data/lib/ArangoRB_Replication.rb +0 -261
- data/lib/ArangoRB_Ser.rb +0 -446
- data/lib/ArangoRB_Task.rb +0 -129
- data/lib/ArangoRB_Tra.rb +0 -169
- data/lib/ArangoRB_Tran.rb +0 -68
- data/lib/ArangoRB_User.rb +0 -157
- data/lib/ArangoRB_Ver.rb +0 -162
- data/spec/arangoRB_helper.rb +0 -4
- data/spec/arangoRestart_helper.rb +0 -14
- data/spec/arangorb-1.3.0.gem +0 -0
- data/spec/lib/0.1.0/arangoAQL_helper.rb +0 -64
- data/spec/lib/0.1.0/arangoC_helper.rb +0 -170
- data/spec/lib/0.1.0/arangoDB_helper.rb +0 -119
- data/spec/lib/0.1.0/arangoDoc_helper.rb +0 -79
- data/spec/lib/0.1.0/arangoE_helper.rb +0 -50
- data/spec/lib/0.1.0/arangoG_helper.rb +0 -78
- data/spec/lib/0.1.0/arangoS_helper.rb +0 -37
- data/spec/lib/0.1.0/arangoT_helper.rb +0 -48
- data/spec/lib/0.1.0/arangoV_helper.rb +0 -65
- data/spec/lib/1.0.0/arangoC_helper.rb +0 -73
- data/spec/lib/1.0.0/arangoDB_helper.rb +0 -48
- data/spec/lib/1.0.0/arangoI_helper.rb +0 -43
- data/spec/lib/1.0.0/arangoS_helper.rb +0 -192
- data/spec/lib/1.0.0/arangoTa_helper.rb +0 -49
- data/spec/lib/1.0.0/arangoTr_helper.rb +0 -15
- data/spec/lib/1.0.0/arangoU_helper.rb +0 -72
- data/spec/lib/1.1.0/arangoRB_helper.rb +0 -144
- data/spec/lib/1.1.0/arangoRB_walks_helper.rb +0 -19
- data/spec/lib/1.2.0/arangoCache_helper.rb +0 -66
- data/spec/lib/1.3.0/arangoHash_helper.rb +0 -30
- data/spec/lib/arangoRB_0.1.0_helper.rb +0 -9
- data/spec/lib/arangoRB_1.0.0_helper.rb +0 -6
- data/spec/lib/arangoRB_1.1.0_helper.rb +0 -2
- data/spec/lib/arangoRB_1.2.0_helper.rb +0 -2
- data/spec/spec_helper.rb +0 -42
@@ -1,79 +0,0 @@
|
|
1
|
-
require_relative './../../spec_helper'
|
2
|
-
|
3
|
-
describe ArangoDocument do
|
4
|
-
context "#new" do
|
5
|
-
it "create a new Document instance without global" do
|
6
|
-
myDocument = ArangoDocument.new collection: "MyCollection", database: "MyDatabase"
|
7
|
-
expect(myDocument.collection.name).to eq "MyCollection"
|
8
|
-
end
|
9
|
-
|
10
|
-
it "create a new instance with global" do
|
11
|
-
myDocument = ArangoDocument.new key: "myKey", body: {"Hello" => "World"}
|
12
|
-
expect(myDocument.key).to eq "myKey"
|
13
|
-
end
|
14
|
-
|
15
|
-
it "create a new Edge instance" do
|
16
|
-
a = ArangoDocument.new(key: "myA", body: {"Hello" => "World"}).create
|
17
|
-
b = ArangoDocument.new(key: "myB", body: {"Hello" => "World"}).create
|
18
|
-
myEdgeDocument = ArangoDocument.new collection: "MyEdgeCollection", from: a, to: b
|
19
|
-
expect(myEdgeDocument.body["_from"]).to eq a.id
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
context "#create" do
|
24
|
-
it "create a new Document" do
|
25
|
-
@myDocument.destroy
|
26
|
-
myDocument = @myDocument.create
|
27
|
-
expect(myDocument.body["Hello"]).to eq "World"
|
28
|
-
end
|
29
|
-
|
30
|
-
it "create a duplicate Document" do
|
31
|
-
myDocument = @myDocument.create
|
32
|
-
expect(myDocument).to eq "cannot create document, unique constraint violated"
|
33
|
-
end
|
34
|
-
|
35
|
-
it "create a new Edge" do
|
36
|
-
myDoc = @myCollection.create_document document: [{"A" => "B", "num" => 1}, {"C" => "D", "num" => 3}]
|
37
|
-
myEdge = ArangoDocument.new collection: "MyEdgeCollection", from: myDoc[0].id, to: myDoc[1].id
|
38
|
-
myEdge = myEdge.create
|
39
|
-
expect(myEdge.body["_from"]).to eq myDoc[0].id
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
context "#info" do
|
44
|
-
it "retrieve Document" do
|
45
|
-
myDocument = @myDocument.retrieve
|
46
|
-
expect(myDocument.body["Hello"]).to eq "World"
|
47
|
-
end
|
48
|
-
|
49
|
-
it "retrieve Edges" do
|
50
|
-
@myEdgeCollection.create_edge from: ["MyCollection/myA", "MyCollection/myB"], to: @myDocument
|
51
|
-
myEdges = @myDocument.retrieve_edges(collection: @myEdgeCollection)
|
52
|
-
expect(myEdges.length).to eq 2
|
53
|
-
end
|
54
|
-
|
55
|
-
it "going in different directions" do
|
56
|
-
myDocument = @myDocument.in("MyEdgeCollection")[0].from.out(@myEdgeCollection)[0].to
|
57
|
-
expect(myDocument.id).to eq @myDocument.id
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
context "#modify" do
|
62
|
-
it "replace" do
|
63
|
-
myDocument = @myDocument.replace body: {"value" => 3}
|
64
|
-
expect(myDocument.body["value"]).to eq 3
|
65
|
-
end
|
66
|
-
|
67
|
-
it "update" do
|
68
|
-
myDocument = @myDocument.update body: {"time" => 13}
|
69
|
-
expect(myDocument.body["value"]).to eq 3
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
context "#destroy" do
|
74
|
-
it "delete a Document" do
|
75
|
-
result = @myDocument.destroy
|
76
|
-
expect(result).to eq true
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|
@@ -1,50 +0,0 @@
|
|
1
|
-
require_relative './../../spec_helper'
|
2
|
-
|
3
|
-
describe ArangoEdge do
|
4
|
-
context "#new" do
|
5
|
-
it "create a new Edge instance" do
|
6
|
-
a = ArangoVertex.new(key: "myA", body: {"Hello" => "World"}).create
|
7
|
-
b = ArangoVertex.new(key: "myB", body: {"Hello" => "World"}).create
|
8
|
-
myEdgeDocument = ArangoEdge.new collection: "MyEdgeCollection", from: a, to: b
|
9
|
-
expect(myEdgeDocument.body["_from"]).to eq a.id
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
context "#create" do
|
14
|
-
it "create a new Edge" do
|
15
|
-
myDoc = @myCollection.create_document document: [{"A" => "B", "num" => 1}, {"C" => "D", "num" => 3}]
|
16
|
-
myEdge = ArangoEdge.new from: myDoc[0].id, to: myDoc[1].id, collection: "MyEdgeCollection"
|
17
|
-
myEdge = myEdge.create
|
18
|
-
expect(myEdge.body["_from"]).to eq myDoc[0].id
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
context "#info" do
|
23
|
-
it "retrieve Document" do
|
24
|
-
myDocument = @myEdge.retrieve
|
25
|
-
expect(myDocument.collection.name).to eq "MyEdgeCollection"
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
context "#modify" do
|
30
|
-
it "replace" do
|
31
|
-
a = ArangoVertex.new(body: {"Hello" => "World"}).create
|
32
|
-
b = ArangoVertex.new(body: {"Hello" => "World!!"}).create
|
33
|
-
myDocument = @myEdge.replace body: {"_from" => a.id, "_to" => b.id}
|
34
|
-
expect(myDocument.body["_from"]).to eq a.id
|
35
|
-
end
|
36
|
-
|
37
|
-
it "update" do
|
38
|
-
cc = ArangoVertex.new(body: {"Hello" => "World!!!"}).create
|
39
|
-
myDocument = @myEdge.update body: {"_to" => cc.id}
|
40
|
-
expect(myDocument.body["_to"]).to eq cc.id
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
context "#destroy" do
|
45
|
-
it "delete a Document" do
|
46
|
-
result = @myEdge.destroy
|
47
|
-
expect(result).to eq true
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
@@ -1,78 +0,0 @@
|
|
1
|
-
require_relative './../../spec_helper'
|
2
|
-
|
3
|
-
describe ArangoGraph do
|
4
|
-
context "#new" do
|
5
|
-
it "create a new Graph instance without global" do
|
6
|
-
myGraph = ArangoGraph.new graph: "MyGraph", database: "MyDatabase"
|
7
|
-
expect(myGraph.graph).to eq "MyGraph"
|
8
|
-
end
|
9
|
-
|
10
|
-
it "create a new instance with global" do
|
11
|
-
myGraph = ArangoGraph.new
|
12
|
-
expect(myGraph.graph).to eq "MyGraph"
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
context "#create" do
|
17
|
-
it "create new graph" do
|
18
|
-
@myGraph.destroy
|
19
|
-
myGraph = @myGraph.create
|
20
|
-
expect(myGraph.graph).to eq "MyGraph"
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
context "#info" do
|
25
|
-
it "info graph" do
|
26
|
-
myGraph = @myGraph.retrieve
|
27
|
-
expect(myGraph.graph).to eq "MyGraph"
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
context "#manageVertexCollections" do
|
32
|
-
it "add VertexCollection" do
|
33
|
-
@myGraph.removeEdgeCollection collection: "MyEdgeCollection"
|
34
|
-
@myGraph.removeVertexCollection collection: "MyCollection"
|
35
|
-
myGraph = @myGraph.addVertexCollection collection: "MyCollection"
|
36
|
-
expect(myGraph.orphanCollections[0]).to eq "MyCollection"
|
37
|
-
end
|
38
|
-
|
39
|
-
it "retrieve VertexCollection" do
|
40
|
-
myGraph = @myGraph.vertexCollections
|
41
|
-
expect(myGraph[0].collection).to eq "MyCollection"
|
42
|
-
end
|
43
|
-
|
44
|
-
it "remove VertexCollection" do
|
45
|
-
myGraph = @myGraph.removeVertexCollection collection: "MyCollection"
|
46
|
-
expect(myGraph.orphanCollections[0]).to eq nil
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
context "#manageEdgeCollections" do
|
51
|
-
it "add EdgeCollection" do
|
52
|
-
myGraph = @myGraph.addEdgeCollection collection: "MyEdgeCollection", from: "MyCollection", to: @myCollectionB
|
53
|
-
expect(myGraph.edgeDefinitions[0]["from"][0]).to eq "MyCollection"
|
54
|
-
end
|
55
|
-
|
56
|
-
it "retrieve EdgeCollection" do
|
57
|
-
myGraph = @myGraph.edgeCollections
|
58
|
-
expect(myGraph[0].collection).to eq "MyEdgeCollection"
|
59
|
-
end
|
60
|
-
|
61
|
-
it "replace EdgeCollection" do
|
62
|
-
myGraph = @myGraph.replaceEdgeCollection collection: @myEdgeCollection, from: "MyCollection", to: "MyCollection"
|
63
|
-
expect(myGraph.edgeDefinitions[0]["to"][0]).to eq "MyCollection"
|
64
|
-
end
|
65
|
-
|
66
|
-
it "remove EdgeCollection" do
|
67
|
-
myGraph = @myGraph.removeEdgeCollection collection: "MyEdgeCollection"
|
68
|
-
expect(myGraph.edgeDefinitions[0]).to eq nil
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
context "#destroy" do
|
73
|
-
it "delete graph" do
|
74
|
-
myGraph = @myGraph.destroy
|
75
|
-
expect(myGraph).to be true
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
require_relative './../../spec_helper'
|
2
|
-
|
3
|
-
describe ArangoServer do
|
4
|
-
context "#database" do
|
5
|
-
it "setup a global database" do
|
6
|
-
ArangoServer.database = "MyDatabase"
|
7
|
-
expect(ArangoServer.database.name).to eq "MyDatabase"
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
context "#graph" do
|
12
|
-
it "setup a global graph" do
|
13
|
-
ArangoServer.graph = "MyGraph"
|
14
|
-
expect(ArangoServer.graph.name).to eq "MyGraph"
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
context "#collection" do
|
19
|
-
it "setup a global collection" do
|
20
|
-
ArangoServer.collection = "MyCollection"
|
21
|
-
expect(ArangoServer.collection.name).to eq "MyCollection"
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
context "#verbose" do
|
26
|
-
it "try verbose" do
|
27
|
-
ArangoServer.verbose = true
|
28
|
-
result = ArangoCollection.new(collection: "Test").create
|
29
|
-
expect(result.class).to be Hash
|
30
|
-
end
|
31
|
-
|
32
|
-
it "print verbose" do
|
33
|
-
ArangoServer.verbose = true
|
34
|
-
expect(ArangoServer.verbose).to be true
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
@@ -1,48 +0,0 @@
|
|
1
|
-
require_relative './../../spec_helper'
|
2
|
-
|
3
|
-
describe ArangoTraversal do
|
4
|
-
context "#new" do
|
5
|
-
it "create a new Traversal instance" do
|
6
|
-
myTraversal = ArangoTraversal.new
|
7
|
-
expect(myTraversal.database.name).to eq "MyDatabase"
|
8
|
-
end
|
9
|
-
|
10
|
-
it "instantiate start Vertex" do
|
11
|
-
@myTraversal.vertex = @myDoc[0]
|
12
|
-
expect(@myTraversal.vertex.id).to eq "MyCollection/FirstKey"
|
13
|
-
end
|
14
|
-
|
15
|
-
it "instantiate Graph" do
|
16
|
-
@myTraversal.graph = @myGraph
|
17
|
-
expect(@myTraversal.graph.name).to eq @myGraph.graph
|
18
|
-
end
|
19
|
-
|
20
|
-
it "instantiate EdgeCollection" do
|
21
|
-
@myTraversal.collection = @myEdgeCollection
|
22
|
-
expect(@myTraversal.collection.name).to eq @myEdgeCollection.collection
|
23
|
-
end
|
24
|
-
|
25
|
-
it "instantiate Direction" do
|
26
|
-
@myTraversal.in
|
27
|
-
expect(@myTraversal.direction).to eq "inbound"
|
28
|
-
end
|
29
|
-
|
30
|
-
it "instantiate Max" do
|
31
|
-
@myTraversal.max = 3
|
32
|
-
expect(@myTraversal.max).to eq 3
|
33
|
-
end
|
34
|
-
|
35
|
-
it "instantiate Min" do
|
36
|
-
@myTraversal.min = 1
|
37
|
-
expect(@myTraversal.min).to eq 1
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
context "#execute" do
|
42
|
-
it "execute Traversal" do
|
43
|
-
@myTraversal.any
|
44
|
-
@myTraversal.execute
|
45
|
-
expect(@myTraversal.vertices.length).to be >= 30
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
@@ -1,65 +0,0 @@
|
|
1
|
-
require_relative './../../spec_helper'
|
2
|
-
|
3
|
-
describe ArangoVertex do
|
4
|
-
context "#new" do
|
5
|
-
it "create a new Document instance without global" do
|
6
|
-
myVertex = ArangoVertex.new collection: "MyCollection", database: "MyDatabase", graph: "MyGraph"
|
7
|
-
expect(myVertex.collection.name).to eq "MyCollection"
|
8
|
-
end
|
9
|
-
|
10
|
-
it "create a new instance with global" do
|
11
|
-
myVertex = ArangoVertex.new key: "myKey", body: {"Hello" => "World"}
|
12
|
-
expect(myVertex.key).to eq "myKey"
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
context "#create" do
|
17
|
-
it "create a new Document" do
|
18
|
-
@myVertex.destroy
|
19
|
-
myVertex = @myVertex.create
|
20
|
-
expect(myVertex.body["Hello"]).to eq "World"
|
21
|
-
end
|
22
|
-
|
23
|
-
it "create a duplicate Document" do
|
24
|
-
myVertex = @myVertex.create
|
25
|
-
expect(myVertex).to eq "unique constraint violated"
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
context "#info" do
|
30
|
-
it "retrieve Document" do
|
31
|
-
myVertex = @myVertex.retrieve
|
32
|
-
expect(myVertex.body["Hello"]).to eq "World"
|
33
|
-
end
|
34
|
-
|
35
|
-
it "retrieve Edges" do
|
36
|
-
@myEdgeCollection.create_edge from: ["MyCollection/myA", "MyCollection/myB"], to: @myVertex
|
37
|
-
myEdges = @myVertex.retrieve_edges(collection: @myEdgeCollection)
|
38
|
-
expect(myEdges.length).to eq 2
|
39
|
-
end
|
40
|
-
|
41
|
-
# it "going in different directions" do
|
42
|
-
# myVertex = @myVertex.in("MyEdgeCollection")[0].from.out(@myEdgeCollection)[0].to
|
43
|
-
# expect(myVertex.id).to eq @myVertex.id
|
44
|
-
# end
|
45
|
-
end
|
46
|
-
|
47
|
-
context "#modify" do
|
48
|
-
it "replace" do
|
49
|
-
myVertex = @myVertex.replace body: {"value" => 3}
|
50
|
-
expect(myVertex.body["value"]).to eq 3
|
51
|
-
end
|
52
|
-
|
53
|
-
it "update" do
|
54
|
-
myVertex = @myVertex.update body: {"time" => 13}
|
55
|
-
expect(myVertex.body["value"]).to eq 3
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
context "#destroy" do
|
60
|
-
it "delete a Document" do
|
61
|
-
result = @myVertex.destroy
|
62
|
-
expect(result).to eq true
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
@@ -1,73 +0,0 @@
|
|
1
|
-
require_relative './../../spec_helper'
|
2
|
-
|
3
|
-
describe ArangoCollection do
|
4
|
-
context "#get" do
|
5
|
-
it "revision" do
|
6
|
-
expect(@myCollection.revision.class).to be String
|
7
|
-
end
|
8
|
-
|
9
|
-
it "collection" do
|
10
|
-
expect(@myCollection.rotate).to eq "could not rotate journal: no journal"
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
context "#import" do
|
15
|
-
it "import" do
|
16
|
-
attributes = ["value", "num", "name"]
|
17
|
-
values = [["uno",1,"ONE"],["due",2,"TWO"],["tre",3,"THREE"]]
|
18
|
-
result = @myCollection.import attributes: attributes, values: values
|
19
|
-
expect(result["created"]).to eq 3
|
20
|
-
end
|
21
|
-
|
22
|
-
it "import single" do
|
23
|
-
attributes = ["value", "num", "name"]
|
24
|
-
values = ["uno",1,"ONE"]
|
25
|
-
result = @myCollection.import attributes: attributes, values: values
|
26
|
-
expect(result["created"]).to eq 1
|
27
|
-
end
|
28
|
-
|
29
|
-
it "importJSON" do
|
30
|
-
body = [{"value": "uno", "num": 1, "name": "ONE"}, {"value": "due", "num": 2, "name": "DUE"}]
|
31
|
-
result = @myCollection.importJSON body: body
|
32
|
-
expect(result["created"]).to eq 2
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
context "#export" do
|
37
|
-
it "export" do
|
38
|
-
result = @myCollection.export flush: true
|
39
|
-
expect(result[0].class).to be ArangoDocument
|
40
|
-
end
|
41
|
-
|
42
|
-
it "exportNext" do
|
43
|
-
result = @myCollection.export batchSize: 3, flush: true
|
44
|
-
result = @myCollection.exportNext
|
45
|
-
expect(result[0].class).to be ArangoDocument
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
context "#indexes" do
|
50
|
-
it "indexes" do
|
51
|
-
expect(@myCollection.indexes["indexes"][0].class).to be ArangoIndex
|
52
|
-
end
|
53
|
-
#
|
54
|
-
# it "retrieve" do
|
55
|
-
# expect((@myCollection.retrieveIndex id: 0).unique).to be true
|
56
|
-
# end
|
57
|
-
#
|
58
|
-
it "create" do
|
59
|
-
myIndex = @myCollection.createIndex unique: false, fields: "num", type: "hash"
|
60
|
-
expect(myIndex.fields).to eq ["num"]
|
61
|
-
end
|
62
|
-
#
|
63
|
-
# it "delete" do
|
64
|
-
# expect(@myCollection.deleteIndex id: @myIndex.key).to eq true
|
65
|
-
# end
|
66
|
-
end
|
67
|
-
|
68
|
-
context "#replication" do
|
69
|
-
it "data" do
|
70
|
-
expect(@myCollection.data.length).to be > 100
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|
@@ -1,48 +0,0 @@
|
|
1
|
-
require_relative './../../spec_helper'
|
2
|
-
|
3
|
-
describe ArangoDatabase do
|
4
|
-
context "#replication" do
|
5
|
-
it "inventory" do
|
6
|
-
expect(@myDatabase.inventory["collections"].class).to be Array
|
7
|
-
end
|
8
|
-
|
9
|
-
it "clusterInventory" do
|
10
|
-
expect(@myDatabase.clusterInventory).to eq "this operation is only valid on a coordinator in a cluster"
|
11
|
-
end
|
12
|
-
|
13
|
-
# it "logger" do
|
14
|
-
# expect(@myDatabase.logger["state"]["running"]).to be true
|
15
|
-
# end
|
16
|
-
|
17
|
-
# it "lastLogger" do
|
18
|
-
# expect(@myDatabase.loggerFollow.class).to be String
|
19
|
-
# end
|
20
|
-
|
21
|
-
# it "fistTick" do
|
22
|
-
# expect(@myDatabase.firstTick.to_i).to be >= 1
|
23
|
-
# end
|
24
|
-
|
25
|
-
# it "rangeTick" do
|
26
|
-
# expect(@myDatabase.rangeTick[0]["datafile"].class).to be String
|
27
|
-
# end
|
28
|
-
|
29
|
-
# it "configurationReplication" do
|
30
|
-
# expect(@myDatabase.configurationReplication["requestTimeout"]).to eq 600
|
31
|
-
# end
|
32
|
-
|
33
|
-
# it "modifyConfigurationReplication" do
|
34
|
-
# result = @myDatabase.modifyConfigurationReplication autoStart: true
|
35
|
-
# expect(result["autoStart"]).to be true
|
36
|
-
# end
|
37
|
-
end
|
38
|
-
|
39
|
-
context "#user" do
|
40
|
-
it "grant" do
|
41
|
-
expect(@myDatabase.grant user: @myUser).to be true
|
42
|
-
end
|
43
|
-
|
44
|
-
it "revoke" do
|
45
|
-
expect(@myDatabase.revoke user: @myUser).to be true
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|