Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update neo4j version for tests/fix broken/test pretty-up initialization output #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ namespace :server do
desc "Install test server"
task :install do
puts "Installing Neo4j server (community edition)..."
%x[wget http://dist.neo4j.org/neo4j-community-1.5-unix.tar.gz]
%x[tar -xvzf neo4j-community-1.5-unix.tar.gz]
%x[mv neo4j-community-1.5 neo4j_server]
%x[rm neo4j-community-1.5-unix.tar.gz]
%x[wget http://dist.neo4j.org/neo4j-community-1.7-unix.tar.gz]
%x[tar -xvzf neo4j-community-1.7-unix.tar.gz]
%x[mv neo4j-community-1.7 neo4j_server]
%x[rm neo4j-community-1.7-unix.tar.gz]
puts "Neo4j Installed in to neo4j_server directory."
puts "Type 'rake server:start' to start it or 'rake server:stop' to stop"
end
Expand Down
5 changes: 3 additions & 2 deletions lib/architect4r/model/node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ def initialize(properties={})
#
def to_s
prop_data = @properties_data.collect { |key, value| "#{key}='#{value}'" }.join(' ')
"#<#{self.class.name}:#{object_id} id=#{id} #{prop_data} neo4j_uri='#{@raw_data['self']}'>"
raw_data = @raw_data ? "'#{@raw_data['self']}'": 'nil'
"#<#{self.class.name}:#{object_id||''} id=#{id||'nil'} #{prop_data} neo4j_uri=#{raw_data}>"
end

# Calculate hash manually in order to only include unique properties for comparison
Expand Down Expand Up @@ -133,4 +134,4 @@ def self.model_root_relation_type

end

end
end
9 changes: 7 additions & 2 deletions spec/model/node_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@

it "should provide a more readable representation of the object" do
person = Person.create(:name => 'Morpheus', :human => true)
person.to_s.should == "#<Person:#{person.object_id} id=#{person.id} name='Morpheus' created_at='#{person.created_at}' human='true' updated_at='#{person.updated_at}' neo4j_uri='#{TEST_SERVER.node_url(person.id)}'>"
person.to_s.should == "#<Person:#{person.object_id} id=#{person.id} name='Morpheus' human='true' created_at='#{person.created_at}' updated_at='#{person.updated_at}' neo4j_uri='#{TEST_SERVER.node_url(person.id)}'>"
end

it "should provide readable representation of a new object" do
person = Person.new(:name => 'Morpheus', :human => true)
person.to_s.should == "#<Person:#{person.object_id} id=nil name='Morpheus' human='true' neo4j_uri=nil>"
end

end
Expand Down Expand Up @@ -74,4 +79,4 @@

end

end
end