Sha256: 5e3e4913b3b297e9130ceb08bc8181d8ad2a5733858331a89f936632daff3933

Contents?: true

Size: 736 Bytes

Versions: 7

Compression:

Stored size: 736 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe 'property container extension' do

  it "adds [] read accessor method for properties" do
    tom_hanks = Neo4jr::DB.instance.getNodeById(893)
    tom_hanks[:name].should == 'Hanks, Tom'
  end
  
  it 'adds [] setter accessor method for properties' do
    Neo4jr::DB.execute do |neo|
      tom_hanks = neo.getNodeById(893)
      tom_hanks[:testing] = '123'
      tom_hanks[:testing].should == '123'
    end
  end
  
  it 'mass updates properties from a hash' do
    hash = {:a => :b}
    node_created = Neo4jr::DB.execute do |neo|
      node = neo.createNode
      node.update_properties(hash)
      node
    end
    node_created[:a].should == 'b'
  end
  
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
neo4jr-simple-0.2.2 spec/property_container_extension_spec.rb
neo4jr-simple-0.2.1 spec/property_container_extension_spec.rb
neo4jr-simple-0.2.0 spec/property_container_extension_spec.rb
neo4jr-simple-0.1.8 spec/property_container_extension_spec.rb
neo4jr-simple-0.1.7 spec/property_container_extension_spec.rb
neo4jr-simple-0.1.6 spec/property_container_extension_spec.rb
neo4jr-simple-0.1.5 spec/property_container_extension_spec.rb