neography-batch 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/neography-batch/batch.rb +1 -1
- data/neography-batch.gemspec +1 -1
- data/spec/batch_spec.rb +21 -2
- metadata +1 -1
data/Gemfile.lock
CHANGED
data/neography-batch.gemspec
CHANGED
data/spec/batch_spec.rb
CHANGED
@@ -127,7 +127,6 @@ module Neography
|
|
127
127
|
|
128
128
|
result1.should == result2
|
129
129
|
end
|
130
|
-
|
131
130
|
describe "and submit" do
|
132
131
|
it "should combine separate batches into one batch" do
|
133
132
|
batch1 = Batch.new(db)
|
@@ -203,6 +202,26 @@ module Neography
|
|
203
202
|
subject.submit()
|
204
203
|
end
|
205
204
|
end
|
205
|
+
describe "add" do
|
206
|
+
context "with subclassed batch class" do
|
207
|
+
class SubclassedBatch < Batch
|
208
|
+
end
|
209
|
+
let(:batch) { Batch.new }
|
210
|
+
let(:subclassed_batch) { SubclassedBatch.new }
|
211
|
+
|
212
|
+
context "combines commands" do
|
213
|
+
before do
|
214
|
+
batch << [:create_node, {"id" => 2}]
|
215
|
+
subclassed_batch << [:create_node, {"id" => 45}]
|
216
|
+
end
|
217
|
+
it "combines commands" do
|
218
|
+
batch.add(subclassed_batch)
|
219
|
+
batch.should have(2).commands
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
223
|
+
end
|
224
|
+
end
|
206
225
|
describe "add and submit" do
|
207
226
|
it "should raise exception when added element doesn't respond to :each" do
|
208
227
|
-> { subject.add(1) }.should raise_exception(StandardError)
|
@@ -231,7 +250,7 @@ module Neography
|
|
231
250
|
subject.submit()
|
232
251
|
end
|
233
252
|
|
234
|
-
context "
|
253
|
+
context "list contains 2 commands" do
|
235
254
|
before do
|
236
255
|
@john = subject.add [:create_node]
|
237
256
|
@markus = subject.add [:create_node]
|