neography 1.5.0 → 1.5.1

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.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/CHANGELOG.md +939 -0
  4. data/Guardfile +14 -0
  5. data/README.md +16 -14
  6. data/lib/neography/connection.rb +1 -0
  7. data/lib/neography/errors.rb +3 -0
  8. data/lib/neography/node.rb +21 -25
  9. data/lib/neography/property.rb +60 -11
  10. data/lib/neography/property_container.rb +5 -6
  11. data/lib/neography/rest/batch.rb +10 -0
  12. data/lib/neography/rest/node_properties.rb +1 -1
  13. data/lib/neography/version.rb +1 -1
  14. data/neography.gemspec +4 -2
  15. data/spec/integration/authorization_spec.rb +4 -4
  16. data/spec/integration/broken_spatial_spec.rb +6 -6
  17. data/spec/integration/index_spec.rb +6 -6
  18. data/spec/integration/neography_spec.rb +1 -1
  19. data/spec/integration/node_encoding_spec.rb +19 -19
  20. data/spec/integration/node_path_spec.rb +36 -36
  21. data/spec/integration/node_relationship_spec.rb +84 -84
  22. data/spec/integration/node_spec.rb +50 -50
  23. data/spec/integration/parsing_spec.rb +2 -2
  24. data/spec/integration/relationship_spec.rb +10 -10
  25. data/spec/integration/rest_batch_no_streaming_spec.rb +6 -6
  26. data/spec/integration/rest_batch_spec.rb +209 -188
  27. data/spec/integration/rest_batch_streaming_spec.rb +8 -8
  28. data/spec/integration/rest_bulk_spec.rb +23 -23
  29. data/spec/integration/rest_constraints_spec.rb +17 -17
  30. data/spec/integration/rest_experimental_spec.rb +2 -2
  31. data/spec/integration/rest_gremlin_fail_spec.rb +4 -4
  32. data/spec/integration/rest_header_spec.rb +3 -2
  33. data/spec/integration/rest_index_spec.rb +76 -76
  34. data/spec/integration/rest_labels_spec.rb +13 -13
  35. data/spec/integration/rest_node_spec.rb +50 -50
  36. data/spec/integration/rest_other_node_relationship_spec.rb +50 -50
  37. data/spec/integration/rest_path_spec.rb +55 -55
  38. data/spec/integration/rest_plugin_spec.rb +59 -59
  39. data/spec/integration/rest_relationship_spec.rb +77 -77
  40. data/spec/integration/rest_relationship_types_spec.rb +2 -2
  41. data/spec/integration/rest_schema_index_spec.rb +6 -6
  42. data/spec/integration/rest_spatial_spec.rb +50 -50
  43. data/spec/integration/rest_transaction_spec.rb +67 -67
  44. data/spec/integration/rest_traverse_spec.rb +40 -40
  45. data/spec/integration/unmanaged_spec.rb +3 -3
  46. data/spec/matchers.rb +2 -2
  47. data/spec/neography_spec.rb +3 -3
  48. data/spec/spec_helper.rb +2 -2
  49. data/spec/unit/config_spec.rb +95 -20
  50. data/spec/unit/connection_spec.rb +40 -40
  51. data/spec/unit/node_spec.rb +12 -12
  52. data/spec/unit/properties_spec.rb +174 -29
  53. data/spec/unit/relationship_spec.rb +16 -16
  54. data/spec/unit/rest/batch_spec.rb +23 -23
  55. data/spec/unit/rest/clean_spec.rb +1 -1
  56. data/spec/unit/rest/constraints_spec.rb +6 -6
  57. data/spec/unit/rest/cypher_spec.rb +1 -1
  58. data/spec/unit/rest/extensions_spec.rb +2 -2
  59. data/spec/unit/rest/gremlin_spec.rb +3 -3
  60. data/spec/unit/rest/helpers_spec.rb +19 -19
  61. data/spec/unit/rest/labels_spec.rb +10 -10
  62. data/spec/unit/rest/node_auto_indexes_spec.rb +13 -13
  63. data/spec/unit/rest/node_indexes_spec.rb +22 -22
  64. data/spec/unit/rest/node_paths_spec.rb +7 -7
  65. data/spec/unit/rest/node_properties_spec.rb +15 -15
  66. data/spec/unit/rest/node_relationships_spec.rb +10 -10
  67. data/spec/unit/rest/node_traversal_spec.rb +1 -1
  68. data/spec/unit/rest/nodes_spec.rb +32 -32
  69. data/spec/unit/rest/relationship_auto_indexes_spec.rb +12 -12
  70. data/spec/unit/rest/relationship_indexes_spec.rb +21 -21
  71. data/spec/unit/rest/relationship_properties_spec.rb +15 -15
  72. data/spec/unit/rest/relationship_types_spec.rb +1 -1
  73. data/spec/unit/rest/relationships_spec.rb +2 -2
  74. data/spec/unit/rest/schema_index_spec.rb +3 -3
  75. data/spec/unit/rest/transactions_spec.rb +4 -4
  76. metadata +32 -3
  77. data/ChangeLog +0 -658
@@ -11,8 +11,8 @@ describe Neography::Rest do
11
11
  new_node2 = @neo.create_node
12
12
  new_relationship = @neo.create_relationship("friends", new_node1, new_node2)
13
13
  rel_types = @neo.list_relationship_types
14
- rel_types.should_not be_nil
15
- rel_types.should include("friends")
14
+ expect(rel_types).not_to be_nil
15
+ expect(rel_types).to include("friends")
16
16
  end
17
17
  end
18
18
  end
@@ -8,8 +8,8 @@ describe Neography::Rest do
8
8
  describe "create a schema index" do
9
9
  it "can create a schema index" do
10
10
  si = @neo.create_schema_index("person", ["name"])
11
- si.should_not be_nil
12
- si["property_keys"].should include("name")
11
+ expect(si).not_to be_nil
12
+ expect(si["property_keys"]).to include("name")
13
13
  end
14
14
 
15
15
  end
@@ -17,16 +17,16 @@ describe Neography::Rest do
17
17
  describe "list schema indexes" do
18
18
  it "can get a listing of node indexes" do
19
19
  si = @neo.get_schema_index("person")
20
- si.should_not be_nil
21
- si.first["label"].should include("person")
22
- si.first["property_keys"].should include("name")
20
+ expect(si).not_to be_nil
21
+ expect(si.first["label"]).to include("person")
22
+ expect(si.first["property_keys"]).to include("name")
23
23
  end
24
24
  end
25
25
 
26
26
  describe "drop schema indexes" do
27
27
  it "can drop an existing schema index" do
28
28
  si = @neo.delete_schema_index("person", "name")
29
- si.should be_nil
29
+ expect(si).to be_nil
30
30
  end
31
31
  end
32
32
  end
@@ -8,51 +8,51 @@ describe Neography::Rest do
8
8
  describe "find the spatial plugin" do
9
9
  it "can get a description of the spatial plugin" do
10
10
  si = @neo.get_spatial
11
- si.should_not be_nil
12
- si["graphdb"]["addEditableLayer"].should_not be_nil
11
+ expect(si).not_to be_nil
12
+ expect(si["graphdb"]["addEditableLayer"]).not_to be_nil
13
13
  end
14
14
  end
15
15
 
16
16
  describe "add a point layer" do
17
17
  it "can add a simple point layer" do
18
18
  pl = @neo.add_point_layer("restaurants")
19
- pl.should_not be_nil
20
- pl.first["data"]["layer"].should == "restaurants"
21
- pl.first["data"]["geomencoder_config"].should == "lon:lat"
19
+ expect(pl).not_to be_nil
20
+ expect(pl.first["data"]["layer"]).to eq("restaurants")
21
+ expect(pl.first["data"]["geomencoder_config"]).to eq("lon:lat")
22
22
  end
23
23
 
24
24
  it "can add a simple point layer with lat and long" do
25
25
  pl = @neo.add_point_layer("coffee_shops", "latitude", "longitude")
26
- pl.should_not be_nil
27
- pl.first["data"]["layer"].should == "coffee_shops"
28
- pl.first["data"]["geomencoder_config"].should == "longitude:latitude"
26
+ expect(pl).not_to be_nil
27
+ expect(pl.first["data"]["layer"]).to eq("coffee_shops")
28
+ expect(pl.first["data"]["geomencoder_config"]).to eq("longitude:latitude")
29
29
  end
30
30
  end
31
31
 
32
32
  describe "add an editable layer" do
33
33
  it "can add an editable layer" do
34
34
  el = @neo.add_editable_layer("zipcodes", "WKT", "wkt")
35
- el.should_not be_nil
36
- el.first["data"]["layer"].should == "zipcodes"
37
- el.first["data"]["geomencoder_config"].should == "wkt"
35
+ expect(el).not_to be_nil
36
+ expect(el.first["data"]["layer"]).to eq("zipcodes")
37
+ expect(el.first["data"]["geomencoder_config"]).to eq("wkt")
38
38
  end
39
39
  end
40
40
 
41
41
  describe "get a spatial layer" do
42
42
  it "can get a layer" do
43
43
  sl = @neo.get_layer("restaurants")
44
- sl.should_not be_nil
45
- sl.first["data"]["layer"].should == "restaurants"
44
+ expect(sl).not_to be_nil
45
+ expect(sl.first["data"]["layer"]).to eq("restaurants")
46
46
  end
47
47
  end
48
48
 
49
49
  describe "create a spatial index" do
50
50
  it "can create a spatial index" do
51
51
  index = @neo.create_spatial_index("restaurants")
52
- index["provider"].should == "spatial"
53
- index["geometry_type"].should == "point"
54
- index["lat"].should == "lat"
55
- index["lon"].should == "lon"
52
+ expect(index["provider"]).to eq("spatial")
53
+ expect(index["geometry_type"]).to eq("point")
54
+ expect(index["lat"]).to eq("lat")
55
+ expect(index["lon"]).to eq("lon")
56
56
  end
57
57
  end
58
58
 
@@ -60,8 +60,8 @@ describe Neography::Rest do
60
60
  it "can add a geometry" do
61
61
  geometry = "LINESTRING (15.2 60.1, 15.3 60.1)"
62
62
  geo = @neo.add_geometry_to_layer("zipcodes", geometry)
63
- geo.should_not be_nil
64
- geo.first["data"]["wkt"].should == geometry
63
+ expect(geo).not_to be_nil
64
+ expect(geo.first["data"]["wkt"]).to eq(geometry)
65
65
  end
66
66
  end
67
67
 
@@ -69,12 +69,12 @@ describe Neography::Rest do
69
69
  it "can update a geometry" do
70
70
  geometry = "LINESTRING (15.2 60.1, 15.3 60.1)"
71
71
  geo = @neo.add_geometry_to_layer("zipcodes", geometry)
72
- geo.should_not be_nil
73
- geo.first["data"]["wkt"].should == geometry
72
+ expect(geo).not_to be_nil
73
+ expect(geo.first["data"]["wkt"]).to eq(geometry)
74
74
  geometry = "LINESTRING (14.7 60.1, 15.3 60.1)"
75
75
  existing_geo = @neo.edit_geometry_from_layer("zipcodes", geometry, geo)
76
- existing_geo.first["data"]["wkt"].should == geometry
77
- existing_geo.first["self"].split('/').last.to_i.should == geo.first["self"].split('/').last.to_i
76
+ expect(existing_geo.first["data"]["wkt"]).to eq(geometry)
77
+ expect(existing_geo.first["self"].split('/').last.to_i).to eq(geo.first["self"].split('/').last.to_i)
78
78
  end
79
79
  end
80
80
 
@@ -82,14 +82,14 @@ describe Neography::Rest do
82
82
  it "can add a node to a simple point layer" do
83
83
  properties = {:name => "Max's Restaurant", :lat => 41.8819, :lon => 87.6278}
84
84
  node = @neo.create_node(properties)
85
- node.should_not be_nil
85
+ expect(node).not_to be_nil
86
86
  added = @neo.add_node_to_layer("restaurants", node)
87
- added.first["data"]["lat"].should == properties[:lat]
88
- added.first["data"]["lon"].should == properties[:lon]
87
+ expect(added.first["data"]["lat"]).to eq(properties[:lat])
88
+ expect(added.first["data"]["lon"]).to eq(properties[:lon])
89
89
 
90
90
  added = @neo.add_node_to_index("restaurants", "dummy", "dummy", node)
91
- added["data"]["lat"].should == properties[:lat]
92
- added["data"]["lon"].should == properties[:lon]
91
+ expect(added["data"]["lat"]).to eq(properties[:lat])
92
+ expect(added["data"]["lon"]).to eq(properties[:lon])
93
93
  end
94
94
  end
95
95
 
@@ -97,10 +97,10 @@ describe Neography::Rest do
97
97
  it "can find a geometry in a bounding box" do
98
98
  properties = {:name => "Max's Restaurant", :lat => 41.8819, :lon => 87.6278}
99
99
  node = @neo.find_geometries_in_bbox("restaurants", 87.5, 87.7, 41.7, 41.9)
100
- node.should_not be_empty
101
- node.first["data"]["lat"].should == properties[:lat]
102
- node.first["data"]["lon"].should == properties[:lon]
103
- node.first["data"]["name"].should == "Max's Restaurant"
100
+ expect(node).not_to be_empty
101
+ expect(node.first["data"]["lat"]).to eq(properties[:lat])
102
+ expect(node.first["data"]["lon"]).to eq(properties[:lon])
103
+ expect(node.first["data"]["name"]).to eq("Max's Restaurant")
104
104
  end
105
105
 
106
106
  it "can find a geometry in a bounding box using cypher" do
@@ -109,9 +109,9 @@ describe Neography::Rest do
109
109
  node = @neo.create_node(properties)
110
110
  added = @neo.add_node_to_index("geombbcypher", "dummy", "dummy", node)
111
111
  existing_node = @neo.execute_query("start node = node:geombbcypher('bbox:[15.0,15.3,60.0,60.2]') return node")
112
- existing_node.should_not be_empty
113
- existing_node["data"][0][0]["data"]["lat"].should == properties[:lat]
114
- existing_node["data"][0][0]["data"]["lon"].should == properties[:lon]
112
+ expect(existing_node).not_to be_empty
113
+ expect(existing_node["data"][0][0]["data"]["lat"]).to eq(properties[:lat])
114
+ expect(existing_node["data"][0][0]["data"]["lon"]).to eq(properties[:lon])
115
115
  end
116
116
 
117
117
  it "can find a geometry in a bounding box using cypher two" do
@@ -120,9 +120,9 @@ describe Neography::Rest do
120
120
  node = @neo.create_node(properties)
121
121
  added = @neo.add_node_to_spatial_index("geombbcypher2", node)
122
122
  existing_node = @neo.execute_query("start node = node:geombbcypher2('bbox:[15.0,15.3,60.0,60.2]') return node")
123
- existing_node.should_not be_empty
124
- existing_node["data"][0][0]["data"]["lat"].should == properties[:lat]
125
- existing_node["data"][0][0]["data"]["lon"].should == properties[:lon]
123
+ expect(existing_node).not_to be_empty
124
+ expect(existing_node["data"][0][0]["data"]["lat"]).to eq(properties[:lat])
125
+ expect(existing_node["data"][0][0]["data"]["lon"]).to eq(properties[:lon])
126
126
  end
127
127
 
128
128
  end
@@ -131,10 +131,10 @@ describe Neography::Rest do
131
131
  it "can find a geometry within distance" do
132
132
  properties = {:name => "Max's Restaurant", :lat => 41.8819, :lon => 87.6278}
133
133
  node = @neo.find_geometries_within_distance("restaurants", 87.627, 41.881, 10)
134
- node.should_not be_empty
135
- node.first["data"]["lat"].should == properties[:lat]
136
- node.first["data"]["lon"].should == properties[:lon]
137
- node.first["data"]["name"].should == "Max's Restaurant"
134
+ expect(node).not_to be_empty
135
+ expect(node.first["data"]["lat"]).to eq(properties[:lat])
136
+ expect(node.first["data"]["lon"]).to eq(properties[:lon])
137
+ expect(node.first["data"]["name"]).to eq("Max's Restaurant")
138
138
  end
139
139
 
140
140
  it "can find a geometry within distance using cypher" do
@@ -143,10 +143,10 @@ describe Neography::Rest do
143
143
  node = @neo.create_node(properties)
144
144
  added = @neo.add_node_to_index("geowdcypher", "dummy", "dummy", node)
145
145
  existing_node = @neo.execute_query("start n = node:geowdcypher({bbox}) return n", {:bbox => "withinDistance:[60.0,15.0,100.0]"})
146
- existing_node.should_not be_empty
147
- existing_node.should_not be_empty
148
- existing_node["data"][0][0]["data"]["lat"].should == properties[:lat]
149
- existing_node["data"][0][0]["data"]["lon"].should == properties[:lon]
146
+ expect(existing_node).not_to be_empty
147
+ expect(existing_node).not_to be_empty
148
+ expect(existing_node["data"][0][0]["data"]["lat"]).to eq(properties[:lat])
149
+ expect(existing_node["data"][0][0]["data"]["lon"]).to eq(properties[:lon])
150
150
  end
151
151
 
152
152
  it "can find a geometry within distance using cypher 2" do
@@ -155,10 +155,10 @@ describe Neography::Rest do
155
155
  node = @neo.create_node(properties)
156
156
  added = @neo.add_node_to_spatial_index("geowdcypher2", node)
157
157
  existing_node = @neo.execute_query("start n = node:geowdcypher2({bbox}) return n", {:bbox => "withinDistance:[60.0,15.0,100.0]"})
158
- existing_node.should_not be_empty
159
- existing_node.should_not be_empty
160
- existing_node["data"][0][0]["data"]["lat"].should == properties[:lat]
161
- existing_node["data"][0][0]["data"]["lon"].should == properties[:lon]
158
+ expect(existing_node).not_to be_empty
159
+ expect(existing_node).not_to be_empty
160
+ expect(existing_node["data"][0][0]["data"]["lat"]).to eq(properties[:lat])
161
+ expect(existing_node["data"][0][0]["data"]["lon"]).to eq(properties[:lon])
162
162
  end
163
163
 
164
164
  end
@@ -8,26 +8,26 @@ describe Neography::Rest do
8
8
  describe "start a transaction" do
9
9
  it "can start a transaction" do
10
10
  tx = @neo.begin_transaction
11
- tx.should have_key("transaction")
12
- tx["results"].should be_empty
11
+ expect(tx).to have_key("transaction")
12
+ expect(tx["results"]).to be_empty
13
13
  end
14
14
 
15
15
  it "can start a transaction with statements" do
16
16
  tx = @neo.begin_transaction("start n=node(0) return n")
17
- tx.should have_key("transaction")
18
- tx.should have_key("results")
19
- tx["results"].should_not be_empty
17
+ expect(tx).to have_key("transaction")
18
+ expect(tx).to have_key("results")
19
+ expect(tx["results"]).not_to be_empty
20
20
  end
21
21
 
22
22
  it "can start a transaction with statements and represent them as a graph" do
23
23
  tx = @neo.begin_transaction(["CREATE ( bike:Bike { weight: 10 } ) CREATE ( frontWheel:Wheel { spokes: 3 } ) CREATE ( backWheel:Wheel { spokes: 32 } ) CREATE p1 = bike -[:HAS { position: 1 } ]-> frontWheel CREATE p2 = bike -[:HAS { position: 2 } ]-> backWheel RETURN bike, p1, p2",
24
24
  ["row", "graph", "rest"]])
25
- tx.should have_key("transaction")
26
- tx.should have_key("results")
27
- tx["results"].should_not be_empty
28
- tx["results"].first["data"].first["row"].should_not be_empty
29
- tx["results"].first["data"].first["graph"].should_not be_empty
30
- tx["results"].first["data"].first["rest"].should_not be_empty
25
+ expect(tx).to have_key("transaction")
26
+ expect(tx).to have_key("results")
27
+ expect(tx["results"]).not_to be_empty
28
+ expect(tx["results"].first["data"].first["row"]).not_to be_empty
29
+ expect(tx["results"].first["data"].first["graph"]).not_to be_empty
30
+ expect(tx["results"].first["data"].first["rest"]).not_to be_empty
31
31
  end
32
32
 
33
33
 
@@ -36,12 +36,12 @@ describe Neography::Rest do
36
36
  describe "keep a transaction" do
37
37
  it "can keep a transaction" do
38
38
  tx = @neo.begin_transaction
39
- tx.should have_key("transaction")
40
- tx["results"].should be_empty
39
+ expect(tx).to have_key("transaction")
40
+ expect(tx["results"]).to be_empty
41
41
  sleep(1)
42
42
  existing_tx = @neo.keep_transaction(tx)
43
- existing_tx.should have_key("transaction")
44
- existing_tx["transaction"]["expires"].should > tx["transaction"]["expires"]
43
+ expect(existing_tx).to have_key("transaction")
44
+ expect(existing_tx["transaction"]["expires"]).to be > tx["transaction"]["expires"]
45
45
  end
46
46
  end
47
47
 
@@ -49,42 +49,42 @@ describe Neography::Rest do
49
49
  describe "add to a transaction" do
50
50
  it "can add to a transaction" do
51
51
  tx = @neo.begin_transaction
52
- tx.should have_key("transaction")
53
- tx["results"].should be_empty
52
+ expect(tx).to have_key("transaction")
53
+ expect(tx["results"]).to be_empty
54
54
  existing_tx = @neo.in_transaction(tx, "start n=node(0) return n")
55
- existing_tx.should have_key("transaction")
56
- existing_tx.should have_key("results")
57
- existing_tx["results"].should_not be_empty
55
+ expect(existing_tx).to have_key("transaction")
56
+ expect(existing_tx).to have_key("results")
57
+ expect(existing_tx["results"]).not_to be_empty
58
58
  end
59
59
 
60
60
  it "can add to a transaction with parameters" do
61
61
  tx = @neo.begin_transaction
62
- tx.should have_key("transaction")
63
- tx["results"].should be_empty
62
+ expect(tx).to have_key("transaction")
63
+ expect(tx["results"]).to be_empty
64
64
  existing_tx = @neo.in_transaction(tx, ["start n=node({id}) return n", {:id => 0}])
65
- existing_tx.should have_key("transaction")
66
- existing_tx.should have_key("results")
67
- existing_tx["results"].should_not be_empty
65
+ expect(existing_tx).to have_key("transaction")
66
+ expect(existing_tx).to have_key("results")
67
+ expect(existing_tx["results"]).not_to be_empty
68
68
  end
69
69
 
70
70
  it "can add to a transaction with representation" do
71
71
  tx = @neo.begin_transaction
72
- tx.should have_key("transaction")
73
- tx["results"].should be_empty
72
+ expect(tx).to have_key("transaction")
73
+ expect(tx["results"]).to be_empty
74
74
  existing_tx = @neo.in_transaction(tx, ["start n=node(0) return n", [:row,:rest]])
75
- existing_tx.should have_key("transaction")
76
- existing_tx.should have_key("results")
77
- existing_tx["results"].should_not be_empty
75
+ expect(existing_tx).to have_key("transaction")
76
+ expect(existing_tx).to have_key("results")
77
+ expect(existing_tx["results"]).not_to be_empty
78
78
  end
79
79
 
80
80
  it "can add to a transaction with parameters and representation" do
81
81
  tx = @neo.begin_transaction
82
- tx.should have_key("transaction")
83
- tx["results"].should be_empty
82
+ expect(tx).to have_key("transaction")
83
+ expect(tx["results"]).to be_empty
84
84
  existing_tx = @neo.in_transaction(tx, ["start n=node({id}) return n", {:id => 0}, [:row,:rest]])
85
- existing_tx.should have_key("transaction")
86
- existing_tx.should have_key("results")
87
- existing_tx["results"].should_not be_empty
85
+ expect(existing_tx).to have_key("transaction")
86
+ expect(existing_tx).to have_key("results")
87
+ expect(existing_tx["results"]).not_to be_empty
88
88
  end
89
89
 
90
90
  end
@@ -92,52 +92,52 @@ describe Neography::Rest do
92
92
  describe "commit a transaction" do
93
93
  it "can commit an opened empty transaction" do
94
94
  tx = @neo.begin_transaction
95
- tx.should have_key("transaction")
96
- tx["results"].should be_empty
95
+ expect(tx).to have_key("transaction")
96
+ expect(tx["results"]).to be_empty
97
97
  existing_tx = @neo.commit_transaction(tx)
98
- existing_tx.should have_key("results")
99
- existing_tx["results"].should be_empty
98
+ expect(existing_tx).to have_key("results")
99
+ expect(existing_tx["results"]).to be_empty
100
100
  end
101
101
 
102
102
  it "can commit an opened transaction" do
103
103
  tx = @neo.begin_transaction("start n=node(0) return n")
104
- tx.should have_key("transaction")
105
- tx["results"].should_not be_empty
104
+ expect(tx).to have_key("transaction")
105
+ expect(tx["results"]).not_to be_empty
106
106
  existing_tx = @neo.commit_transaction(tx)
107
- existing_tx.should_not have_key("transaction")
108
- existing_tx.should have_key("results")
109
- existing_tx["results"].should be_empty
107
+ expect(existing_tx).not_to have_key("transaction")
108
+ expect(existing_tx).to have_key("results")
109
+ expect(existing_tx["results"]).to be_empty
110
110
  end
111
111
 
112
112
  it "can commit an opened transaction with new statements" do
113
113
  tx = @neo.begin_transaction
114
- tx.should have_key("transaction")
115
- tx["results"].should be_empty
114
+ expect(tx).to have_key("transaction")
115
+ expect(tx["results"]).to be_empty
116
116
  existing_tx = @neo.commit_transaction(tx, "start n=node(0) return n")
117
- existing_tx.should_not have_key("transaction")
118
- existing_tx.should have_key("results")
119
- existing_tx["results"].should_not be_empty
117
+ expect(existing_tx).not_to have_key("transaction")
118
+ expect(existing_tx).to have_key("results")
119
+ expect(existing_tx["results"]).not_to be_empty
120
120
  end
121
121
 
122
122
  it "can commit an new transaction right away" do
123
123
  tx = @neo.commit_transaction(["start n=node(0) return n"])
124
- tx.should_not have_key("transaction")
125
- tx.should have_key("results")
126
- tx["results"].should_not be_empty
124
+ expect(tx).not_to have_key("transaction")
125
+ expect(tx).to have_key("results")
126
+ expect(tx["results"]).not_to be_empty
127
127
  end
128
128
 
129
129
  it "can commit an new transaction right away with parameters" do
130
130
  tx = @neo.commit_transaction(["start n=node({id}) return n", {:id => 0}])
131
- tx.should_not have_key("transaction")
132
- tx.should have_key("results")
133
- tx["results"].should_not be_empty
131
+ expect(tx).not_to have_key("transaction")
132
+ expect(tx).to have_key("results")
133
+ expect(tx["results"]).not_to be_empty
134
134
  end
135
135
 
136
136
  it "can commit an new transaction right away without parameters" do
137
137
  tx = @neo.commit_transaction("start n=node(0) return n")
138
- tx.should_not have_key("transaction")
139
- tx.should have_key("results")
140
- tx["results"].should_not be_empty
138
+ expect(tx).not_to have_key("transaction")
139
+ expect(tx).to have_key("results")
140
+ expect(tx["results"]).not_to be_empty
141
141
  end
142
142
 
143
143
  end
@@ -145,21 +145,21 @@ describe Neography::Rest do
145
145
  describe "rollback a transaction" do
146
146
  it "can rollback an opened empty transaction" do
147
147
  tx = @neo.begin_transaction
148
- tx.should have_key("transaction")
149
- tx["results"].should be_empty
148
+ expect(tx).to have_key("transaction")
149
+ expect(tx["results"]).to be_empty
150
150
  existing_tx = @neo.rollback_transaction(tx)
151
- existing_tx.should have_key("results")
152
- existing_tx["results"].should be_empty
151
+ expect(existing_tx).to have_key("results")
152
+ expect(existing_tx["results"]).to be_empty
153
153
  end
154
154
 
155
155
  it "can rollback an opened transaction" do
156
156
  tx = @neo.begin_transaction("start n=node(0) return n")
157
- tx.should have_key("transaction")
158
- tx["results"].should_not be_empty
157
+ expect(tx).to have_key("transaction")
158
+ expect(tx["results"]).not_to be_empty
159
159
  existing_tx = @neo.rollback_transaction(tx)
160
- existing_tx.should_not have_key("transaction")
161
- existing_tx.should have_key("results")
162
- existing_tx["results"].should be_empty
160
+ expect(existing_tx).not_to have_key("transaction")
161
+ expect(existing_tx).to have_key("results")
162
+ expect(existing_tx["results"]).to be_empty
163
163
  end
164
164
  end
165
165