Skip to content

Commit

Permalink
adding fakeweb and starting to create fake http responses
Browse files Browse the repository at this point in the history
  • Loading branch information
maxdemarzi committed Nov 15, 2010
1 parent 3e4206d commit 0eff227
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 11 deletions.
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ GEM
specs:
crack (0.1.8)
diff-lcs (1.1.2)
fakeweb (1.3.0)
httparty (0.6.1)
crack (= 0.1.8)
json (1.4.6-java)
Expand All @@ -29,6 +30,7 @@ PLATFORMS
java

DEPENDENCIES
fakeweb (~> 1.3.0)
httparty (~> 0.6.1)
json
neography!
Expand Down
1 change: 1 addition & 0 deletions neography.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Gem::Specification.new do |s|

s.add_development_dependency "rspec", "~> 2.0.0.beta.22"
s.add_development_dependency "net-http-spy", "~> 0.2.1"
s.add_development_dependency "fakeweb", "~> 1.3.0"
s.add_dependency "httparty", "~> 0.6.1"
s.add_dependency "json"
end
13 changes: 2 additions & 11 deletions spec/neography_spec.rb → spec/integration/node_spec.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
require 'neography'

describe Neography::Neo do
it "has a root node" do
Neography::Neo.root_node.should include("reference_node")
end
end
require File.join(File.dirname(__FILE__), '..', 'spec_helper')

describe Neography::Node do
it "can create an empty node" do
Expand Down Expand Up @@ -83,7 +77,4 @@
Neography::Node.del(node2[:neo_id]).should be_nil
end




end
end
7 changes: 7 additions & 0 deletions spec/integration/root_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require File.join(File.dirname(__FILE__), '..', 'spec_helper')

describe Neography::Neo do
it "has a root node" do
Neography::Neo.root_node.should include("reference_node")
end
end
13 changes: 13 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
require 'neography'
require 'fakeweb'

Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}

FakeWeb.allow_net_connect = false

#To test against a real database:
#1. Make sure empty database is running (./bin/neo4j-rest start)
#2. Uncomment the next two lines
#FakeWeb.clean_registry
#FakeWeb.allow_net_connect = true

5 changes: 5 additions & 0 deletions spec/support/fake_root_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FakeWeb.register_uri(:get, "http://localhost:9999/", :body => '{
"index" : "http://localhost:9999/index",
"node" : "http://localhost:9999/node",
"reference_node" : "http://localhost:9999/node/0"
}')

0 comments on commit 0eff227

Please sign in to comment.