-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f800179
commit f0bc117
Showing
6 changed files
with
95 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
require 'spec_helper' | ||
|
||
describe Neography::Rest, :slow => true do | ||
before(:each) do | ||
@neo = Neography::Rest.new | ||
end | ||
|
||
describe "can perform" do | ||
it "is fast" do | ||
Benchmark.bm do |x| | ||
x.report(" 100 Times") { 100.times { @neo.create_node } } | ||
x.report(" 500 Times") { 500.times { @neo.create_node } } | ||
x.report("1000 Times") { 1000.times { @neo.create_node } } | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -452,5 +452,5 @@ | |
end | ||
|
||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
require 'spec_helper' | ||
|
||
describe Neography::Rest do | ||
before(:each) do | ||
@neo = Neography::Rest.new | ||
end | ||
|
||
describe "streaming" do | ||
|
||
it "can send a 1000 item batch" do | ||
commands = [] | ||
1000.times do |x| | ||
commands << [:create_node, {"name" => "Max " + x.to_s}] | ||
end | ||
batch_result = @neo.batch *commands | ||
batch_result.first["body"]["data"]["name"].should == "Max 0" | ||
batch_result.last["body"]["data"]["name"].should == "Max 999" | ||
end | ||
|
||
it "can send a 10000 item batch" do | ||
commands = [] | ||
10000.times do |x| | ||
commands << [:get_node, 0] | ||
end | ||
batch_result = @neo.batch *commands | ||
batch_result.first["body"]["self"].split('/').last.should == "0" | ||
batch_result.last["body"]["self"].split('/').last.should == "0" | ||
end | ||
|
||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters