neography 1.5.0 → 1.5.1

Sign up to get free protection for your applications and to get access to all the features.
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
data/Guardfile ADDED
@@ -0,0 +1,14 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ guard :rspec do
5
+ # Just rerun the whole suite until the file names are matching
6
+ # in lib/ and spec/
7
+ #
8
+ # watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
9
+ # watch(%r{^lib/(.+)\.rb$}) { |m| "spec/unit/lib/#{m[1]}_spec.rb" }
10
+ watch(%r{^lib/(.+)\.rb$}) { "spec" }
11
+
12
+ watch(%r{^spec/.+_spec\.rb$})
13
+ watch('spec/spec_helper.rb') { "spec" }
14
+ end
data/README.md CHANGED
@@ -61,20 +61,22 @@ Configure Neography as follows:
61
61
  ```ruby
62
62
  # these are the default values:
63
63
  Neography.configure do |config|
64
- config.protocol = "http://"
65
- config.server = "localhost"
66
- config.port = 7474
67
- config.directory = "" # prefix this path with '/'
68
- config.cypher_path = "/cypher"
69
- config.gremlin_path = "/ext/GremlinPlugin/graphdb/execute_script"
70
- config.log_file = "neography.log"
71
- config.log_enabled = false
72
- config.slow_log_threshold = 0 # time in ms for query logging
73
- config.max_threads = 20
74
- config.authentication = nil # 'basic' or 'digest'
75
- config.username = nil
76
- config.password = nil
77
- config.parser = MultiJsonParser
64
+ config.protocol = "http://"
65
+ config.server = "localhost"
66
+ config.port = 7474
67
+ config.directory = "" # prefix this path with '/'
68
+ config.cypher_path = "/cypher"
69
+ config.gremlin_path = "/ext/GremlinPlugin/graphdb/execute_script"
70
+ config.log_file = "neography.log"
71
+ config.log_enabled = false
72
+ config.slow_log_threshold = 0 # time in ms for query logging
73
+ config.max_threads = 20
74
+ config.authentication = nil # 'basic' or 'digest'
75
+ config.username = nil
76
+ config.password = nil
77
+ config.parser = MultiJsonParser
78
+ config.http_send_timeout = 1200
79
+ config.http_receive_timeout = 1200
78
80
  end
79
81
  ```
80
82
 
@@ -234,6 +234,7 @@ module Neography
234
234
  when /NodeNotFoundException/ ; NodeNotFoundException
235
235
  when /NoSuchPropertyException/ ; NoSuchPropertyException
236
236
  when /RelationshipNotFoundException/ ; RelationshipNotFoundException
237
+ when /ParameterNotFoundException/ ; ParameterNotFoundException
237
238
  when /NotFoundException/ ; NotFoundException
238
239
  when /UniquePathNotUniqueException/ ; UniquePathNotUniqueException
239
240
  when /DeadlockDetectedException/ ; DeadlockDetectedException
@@ -54,4 +54,7 @@ module Neography
54
54
  # Unknown batch option exception detected
55
55
  class UnknownBatchOptionException < NeographyError; end
56
56
 
57
+ # A Cypher query is using a parameter that is not supplied
58
+ class ParameterNotFoundException < NeographyError; end
59
+
57
60
  end
@@ -8,36 +8,32 @@ module Neography
8
8
 
9
9
  attr_accessor :neo_server
10
10
 
11
- class << self
12
- def create(props = nil, db = Neography::Rest.new)
13
- raise ArgumentError.new("syntax deprecated") if props.is_a?(Neography::Rest)
11
+ def self.create(props = nil, db = Neography::Rest.new)
12
+ raise ArgumentError.new("syntax deprecated") if props.is_a?(Neography::Rest)
14
13
 
15
- node = self.new(db.create_node(props))
16
- node.neo_server = db
17
- node
18
- end
14
+ node = self.new(db.create_node(props))
15
+ node.neo_server = db
16
+ node
17
+ end
19
18
 
20
- def create_unique(index, key, value, props = nil, db = Neography::Rest.new)
21
- raise ArgumentError.new("syntax deprecated") if props.is_a?(Neography::Rest)
19
+ def self.create_unique(index, key, value, props = nil, db = Neography::Rest.new)
20
+ raise ArgumentError.new("syntax deprecated") if props.is_a?(Neography::Rest)
22
21
 
23
- node = self.new(db.create_unique_node(index, key, value, props))
24
- node.neo_server = db
25
- node
26
- end
22
+ node = self.new(db.create_unique_node(index, key, value, props))
23
+ node.neo_server = db
24
+ node
25
+ end
27
26
 
28
- def load(node, db = Neography::Rest.new)
29
- raise ArgumentError.new("syntax deprecated") if node.is_a?(Neography::Rest)
30
- node = node.first if node.kind_of?(Array)
31
- node = db.get_node(node) if (node.to_s.match(/^\d+$/) or node.to_s.split("/").last.match(/^\d+$/))
32
- if node
33
- node = self.new(node)
34
- node.neo_server = db
35
- end
36
- node
27
+ def self.load(node, db = Neography::Rest.new)
28
+ raise ArgumentError.new("syntax deprecated") if node.is_a?(Neography::Rest)
29
+ node = node.first if node.kind_of?(Array)
30
+ node = db.get_node(node) if (node.to_s.match(/^\d+$/) or node.to_s.split("/").last.match(/^\d+$/))
31
+ if node
32
+ node = self.new(node)
33
+ node.neo_server = db
37
34
  end
38
-
39
- #alias_method :new, :create
40
- end
35
+ node
36
+ end
41
37
 
42
38
  def find(*args)
43
39
  node = self.new
@@ -2,9 +2,7 @@ module Neography
2
2
  module Property
3
3
 
4
4
  def [](key)
5
- key = key.to_sym
6
- return unless respond_to?(key)
7
- @table[key]
5
+ @table[key.to_sym]
8
6
  end
9
7
 
10
8
  def []=(key, value)
@@ -12,38 +10,75 @@ module Neography
12
10
  k_str = key.to_s
13
11
  if value.nil?
14
12
  unless @table[key].nil?
15
- if self.is_a? Neography::Node
13
+ if node?
16
14
  neo_server.remove_node_properties(self.neo_id, [k_str])
17
15
  else
18
16
  neo_server.remove_relationship_properties(self.neo_id, [k_str])
19
17
  end
20
18
  end
19
+ remove_ostruct_member(key)
21
20
  else
22
- if self.is_a? Neography::Node
21
+ if node?
23
22
  neo_server.set_node_properties(self.neo_id, {k_str => value})
24
23
  else
25
24
  neo_server.set_relationship_properties(self.neo_id, {k_str => value})
26
25
  end
27
- new_ostruct_member(key) unless self.respond_to?(key)
26
+ new_ostruct_member(key, value)
27
+ end
28
+ end
29
+
30
+ # Set many properties at once and only issue one http
31
+ # request and update the node/relationship instance on the fly.
32
+ #
33
+ # To remove a property, set its value to nil.
34
+ def set_properties(hash)
35
+ hash.each do |key, value|
36
+ add_or_remove_ostruct_member(key, value)
37
+ end
38
+ rest_reset_properties
39
+ end
40
+
41
+ # As #set_properties, but this one hard resets the node's/relationship's
42
+ # properties to exactly what's given in the hash.
43
+ def reset_properties(hash)
44
+ @table.keys.each{|key| remove_ostruct_member(key)}
45
+ hash.each{|key,value| new_ostruct_member(key,value)}
46
+ rest_reset_properties
47
+ end
48
+
49
+ def add_or_remove_ostruct_member(name, value)
50
+ if value.nil?
51
+ remove_ostruct_member(name)
52
+ else
53
+ new_ostruct_member(name, value)
28
54
  end
29
- @table[key] = value
30
55
  end
31
56
 
32
- def new_ostruct_member(name)
57
+ def new_ostruct_member(name, value)
33
58
  name = name.to_sym
59
+ @table[name] = value
34
60
  unless self.respond_to?(name)
35
61
  meta = class << self; self; end
36
62
  meta.send(:define_method, name) { @table[name] }
37
- meta.send(:define_method, "#{name}=") do |value|
38
- self[name.to_sym] = value
63
+ meta.send(:define_method, "#{name}=") do |new_value|
64
+ self[name.to_sym] = new_value
39
65
  end
40
66
  end
41
67
  name
42
68
  end
43
69
 
70
+ def remove_ostruct_member(name)
71
+ @table.delete(name.to_sym)
72
+ meta = class << self; self; end
73
+ names = [name, "#{name}="].map(&:to_sym)
74
+ names.each do |n|
75
+ meta.send(:remove_method, n) if self.respond_to?(n)
76
+ end
77
+ end
78
+
44
79
  def method_missing(method_sym, *arguments, &block)
45
80
  if (method_sym.to_s =~ /=$/) != nil
46
- new_ostruct_member(method_sym.to_s.chomp("="))
81
+ new_ostruct_member(method_sym.to_s.chomp("="), *arguments)
47
82
 
48
83
  # We just defined the getter/setter above, but we haven't actually
49
84
  # applied them yet.
@@ -57,5 +92,19 @@ module Neography
57
92
  @table.keys
58
93
  end
59
94
 
95
+ def node?
96
+ self.is_a?(Neography::Node)
97
+ end
98
+
99
+ private
100
+
101
+ def rest_reset_properties
102
+ if node?
103
+ neo_server.reset_node_properties(self.neo_id, @table)
104
+ else
105
+ neo_server.reset_relationship_properties(self.neo_id, @table)
106
+ end
107
+ end
108
+
60
109
  end
61
110
  end
@@ -4,7 +4,7 @@ module Neography
4
4
 
5
5
  def initialize(hash=nil)
6
6
  @table = {}
7
- if hash
7
+ unless hash.nil?
8
8
  if hash["self"] # coming from REST API
9
9
  @neo_id = hash["self"].split('/').last
10
10
  data = hash["data"]
@@ -12,16 +12,15 @@ module Neography
12
12
  @neo_id = hash.neo_id
13
13
  data = Hash[*hash.attributes.collect{|x| [x.to_sym, hash.send(x)]}.flatten]
14
14
  elsif hash["data"] # coming from CYPHER
15
- @neo_id = hash["data"].first.first["self"].split('/').last
15
+ @neo_id = hash["data"].first.first["self"].split('/').last
16
16
  data = hash["data"].first.first["data"]
17
17
  end
18
18
  else
19
19
  data = []
20
- end
21
-
20
+ end
21
+
22
22
  for k,v in data
23
- @table[k.to_sym] = v
24
- new_ostruct_member(k)
23
+ new_ostruct_member(k.to_sym, v)
25
24
  end
26
25
  end
27
26
 
@@ -83,6 +83,16 @@ module Neography
83
83
  }
84
84
  end
85
85
  end
86
+
87
+ def batch_create_or_fail_unique_node(index, key, value, properties = {})
88
+ post "/index/node/%{index}?uniqueness=%{function}" % {:index => index, :function => 'create_or_fail'} do
89
+ {
90
+ :key => key,
91
+ :value => value,
92
+ :properties => properties
93
+ }
94
+ end
95
+ end
86
96
 
87
97
  def batch_add_node_to_index(index, key, value, id, unique = false)
88
98
  path = unique ? "/index/node/%{index}?unique" % {:index => index} : "/index/node/%{index}" % {:index => index}
@@ -1,7 +1,7 @@
1
1
  module Neography
2
2
  class Rest
3
3
  module NodeProperties
4
-
4
+
5
5
  def set_node_properties(id, properties)
6
6
  properties.each do |property, value|
7
7
  options = { :body => value.to_json, :headers => json_content_type }
@@ -1,3 +1,3 @@
1
1
  module Neography
2
- VERSION = "1.5.0"
2
+ VERSION = "1.5.1"
3
3
  end
data/neography.gemspec CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
12
12
  s.summary = "ruby wrapper to Neo4j Rest API"
13
13
  s.description = "A Ruby wrapper to the Neo4j Rest API see http://docs.neo4j.org/chunked/stable/rest-api.html for more details."
14
14
  s.license = 'MIT'
15
-
15
+
16
16
  s.rubyforge_project = "neography"
17
17
 
18
18
  s.files = `git ls-files`.split("\n")
@@ -23,12 +23,14 @@ Gem::Specification.new do |s|
23
23
  s.add_development_dependency "rspec", ">= 2.11"
24
24
  s.add_development_dependency "net-http-spy", "0.2.1"
25
25
  s.add_development_dependency "coveralls"
26
+ s.add_development_dependency "debugger"
27
+ s.add_development_dependency "guard-rspec"
26
28
  s.add_dependency "excon", "~> 0.33.0"
27
29
  s.add_dependency "json", ">= 1.7.7"
28
30
  s.add_dependency "os", ">= 0.9.6"
29
31
  s.add_dependency "rubyzip", ">= 1.0.0"
30
32
  s.add_dependency "multi_json", ">= 1.3.2"
31
-
33
+
32
34
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
33
35
  s.add_runtime_dependency 'rake', '>= 0.8.7'
34
36
  else
@@ -6,7 +6,7 @@ describe Neography::Rest, :slow => true do
6
6
  it "can get the root node"do
7
7
  @neo = Neography::Rest.new({:authentication => 'digest', :username => "username", :password => "password"})
8
8
  root_node = @neo.get_root
9
- root_node.should have_key("reference_node")
9
+ expect(root_node).to have_key("reference_node")
10
10
  end
11
11
  end
12
12
 
@@ -14,7 +14,7 @@ describe Neography::Rest, :slow => true do
14
14
  it "can create an empty node" do
15
15
  @neo = Neography::Rest.new({:authentication => 'basic', :username => "username", :password => "password"})
16
16
  new_node = @neo.create_node
17
- new_node.should_not be_nil
17
+ expect(new_node).not_to be_nil
18
18
  end
19
19
  end
20
20
 
@@ -22,7 +22,7 @@ describe Neography::Rest, :slow => true do
22
22
  it "can create an empty node" do
23
23
  @neo = Neography::Rest.new("http://username:password@localhost:7474")
24
24
  new_node = @neo.create_node
25
- new_node.should_not be_nil
25
+ expect(new_node).not_to be_nil
26
26
  end
27
27
  end
28
28
  end
@@ -32,7 +32,7 @@ describe Neography::Rest, :slow => true do
32
32
  it "can create an empty node" do
33
33
  @neo = Neography::Rest.new({:authentication => 'digest', :username => "username", :password => "password"})
34
34
  new_node = @neo.create_node
35
- new_node.should_not be_nil
35
+ expect(new_node).not_to be_nil
36
36
  end
37
37
  end
38
38
  end
@@ -17,12 +17,12 @@ describe Neography::Rest do
17
17
  # getting "The transaction is marked for rollback only." errors
18
18
  # possibly related to a Cypher Transaction Bug.
19
19
  puts batch_result.inspect
20
- batch_result[0].first["data"]["layer"].should == "restaurantsbatch"
21
- batch_result[1].first["data"]["lat"].should == properties[:lat]
22
- batch_result[1].first["data"]["lon"].should == properties[:lon]
23
- batch_result[2].first["data"]["layer"].should == "restaurantsbatch"
24
- batch_result[3].first["data"].should_not be_empty
25
- batch_result[4].first["data"].should_not be_empty
20
+ expect(batch_result[0].first["data"]["layer"]).to eq("restaurantsbatch")
21
+ expect(batch_result[1].first["data"]["lat"]).to eq(properties[:lat])
22
+ expect(batch_result[1].first["data"]["lon"]).to eq(properties[:lon])
23
+ expect(batch_result[2].first["data"]["layer"]).to eq("restaurantsbatch")
24
+ expect(batch_result[3].first["data"]).not_to be_empty
25
+ expect(batch_result[4].first["data"]).not_to be_empty
26
26
  end
27
27
  end
28
28
  end
@@ -30,7 +30,7 @@ describe Neography::Index do
30
30
  new_node = Neography::Node.create("name" => value)
31
31
  new_node.add_to_index("node_test_index", "name", value)
32
32
  existing_node = Neography::Node.find("node_test_index", "name", value)
33
- existing_node.name.should == value
33
+ expect(existing_node.name).to eq(value)
34
34
  end
35
35
 
36
36
  it "can find a node in an index with brackets" do
@@ -39,7 +39,7 @@ describe Neography::Index do
39
39
  new_node = Neography::Node.create("name" => value)
40
40
  new_node.add_to_index(key, "name", value)
41
41
  existing_node = Neography::Node.find(key, "name", value)
42
- existing_node.name.should == value
42
+ expect(existing_node.name).to eq(value)
43
43
  end
44
44
 
45
45
  it "can find a relationship in an index" do
@@ -49,7 +49,7 @@ describe Neography::Index do
49
49
  r = Neography::Relationship.create(:friends, node1, node2, {"name" => value})
50
50
  r.add_to_index("relationship_test_index", "name", value)
51
51
  existing_r = Neography::Relationship.find("relationship_test_index", "name", value)
52
- existing_r.name.should == value
52
+ expect(existing_r.name).to eq(value)
53
53
  end
54
54
 
55
55
  it "can find multiple nodes in an index" do
@@ -62,9 +62,9 @@ describe Neography::Index do
62
62
  node2.add_to_index("node_test_index", "first_name", value1)
63
63
 
64
64
  existing_nodes = Neography::Node.find("node_test_index", "first_name", value1)
65
- existing_nodes.size.should == 2
66
- existing_nodes.first.last_name.should == value2
67
- existing_nodes.last.last_name.should == value3
65
+ expect(existing_nodes.size).to eq(2)
66
+ expect(existing_nodes.first.last_name).to eq(value2)
67
+ expect(existing_nodes.last.last_name).to eq(value3)
68
68
  end
69
69
 
70
70
 
@@ -4,7 +4,7 @@ describe Neography do
4
4
  describe "ref_node", :reference => true do
5
5
  it "can get the reference node" do
6
6
  root_node = Neography.ref_node
7
- root_node.should have_key("self")
7
+ expect(root_node).to have_key("self")
8
8
  end
9
9
  end
10
10
  end
@@ -7,13 +7,13 @@ describe Neography::Node do
7
7
 
8
8
  it "can create a node with UTF-8 encoded properties" do
9
9
  new_node = Neography::Node.create("name" => "美都池水")
10
- new_node.name.should == "美都池水"
10
+ expect(new_node.name).to eq("美都池水")
11
11
  end
12
12
 
13
13
  it "can create a node with more than one UTF-8 encoded properties" do
14
14
  new_node = Neography::Node.create("first_name" => "美都", "last_name" => "池水")
15
- new_node.first_name.should == "美都"
16
- new_node.last_name.should == "池水"
15
+ expect(new_node.first_name).to eq("美都")
16
+ expect(new_node.last_name).to eq("池水")
17
17
  end
18
18
 
19
19
  end
@@ -22,11 +22,11 @@ describe Neography::Node do
22
22
  it "can get a node with UTF-8 encoded properties that exists" do
23
23
  new_node = Neography::Node.create("first_name" => "美都", "last_name" => "池水")
24
24
  existing_node = Neography::Node.load(new_node)
25
- existing_node.should_not be_nil
26
- existing_node.neo_id.should_not be_nil
27
- existing_node.neo_id.should == new_node.neo_id
28
- existing_node.first_name.should == "美都"
29
- existing_node.last_name.should == "池水"
25
+ expect(existing_node).not_to be_nil
26
+ expect(existing_node.neo_id).not_to be_nil
27
+ expect(existing_node.neo_id).to eq(new_node.neo_id)
28
+ expect(existing_node.first_name).to eq("美都")
29
+ expect(existing_node.last_name).to eq("池水")
30
30
  end
31
31
 
32
32
  it "can get a node with UTF-8 encoded properties from an index" do
@@ -37,11 +37,11 @@ describe Neography::Node do
37
37
  @neo.add_node_to_index("test_node_index", key, value, new_node)
38
38
  node_from_index = @neo.get_node_index("test_node_index", key, value)
39
39
  existing_node = Neography::Node.load(node_from_index)
40
- existing_node.should_not be_nil
41
- existing_node.neo_id.should_not be_nil
42
- existing_node.neo_id.should == new_node.neo_id
43
- existing_node.first_name.should == "美都"
44
- existing_node.last_name.should == "池水"
40
+ expect(existing_node).not_to be_nil
41
+ expect(existing_node.neo_id).not_to be_nil
42
+ expect(existing_node.neo_id).to eq(new_node.neo_id)
43
+ expect(existing_node.first_name).to eq("美都")
44
+ expect(existing_node.last_name).to eq("池水")
45
45
  end
46
46
 
47
47
  it "can get a node with UTF-8 encoded properties that exists via cypher" do
@@ -50,11 +50,11 @@ describe Neography::Node do
50
50
  @neo = Neography::Rest.new
51
51
  results = @neo.execute_query(cypher, {:id => new_node.neo_id.to_i})
52
52
  existing_node = Neography::Node.load(results)
53
- existing_node.should_not be_nil
54
- existing_node.neo_id.should_not be_nil
55
- existing_node.neo_id.should == new_node.neo_id
56
- existing_node.first_name.should == "美都"
57
- existing_node.last_name.should == "池水"
53
+ expect(existing_node).not_to be_nil
54
+ expect(existing_node.neo_id).not_to be_nil
55
+ expect(existing_node.neo_id).to eq(new_node.neo_id)
56
+ expect(existing_node.first_name).to eq("美都")
57
+ expect(existing_node.last_name).to eq("池水")
58
58
  end
59
59
 
60
60
  it "can get columns of data from a node with UTF-8 encoded properties that exists via cypher" do
@@ -63,7 +63,7 @@ describe Neography::Node do
63
63
  RETURN me.first_name, me.last_name"
64
64
  @neo = Neography::Rest.new
65
65
  results = @neo.execute_query(cypher, {:id => new_node.neo_id.to_i})
66
- results['data'][0].should == ["美都","池水"]
66
+ expect(results['data'][0]).to eq(["美都","池水"])
67
67
  end
68
68
 
69
69
  end