diametric 0.1.2-java → 0.1.3-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +3 -3
- data/Jarfile +13 -6
- data/LICENSE.txt +2 -2
- data/README.md +57 -26
- data/Rakefile +1 -0
- data/bin/datomic-rest +1 -1
- data/bin/download-datomic +1 -1
- data/datomic_version.yml +2 -2
- data/diametric-java.gemspec +11 -10
- data/ext/diametric/DiametricCollection.java +45 -38
- data/ext/diametric/DiametricConnection.java +16 -15
- data/ext/diametric/DiametricDatabase.java +9 -8
- data/ext/diametric/DiametricEntity.java +104 -21
- data/ext/diametric/DiametricObject.java +12 -1
- data/ext/diametric/DiametricPeer.java +52 -31
- data/ext/diametric/DiametricService.java +2 -0
- data/ext/diametric/DiametricSet.java +11 -4
- data/ext/diametric/DiametricUUID.java +8 -1
- data/ext/diametric/DiametricUtils.java +90 -62
- data/lib/diametric.rb +1 -0
- data/lib/diametric/associations/collection.rb +103 -0
- data/lib/diametric/entity.rb +166 -103
- data/lib/diametric/persistence/common.rb +0 -44
- data/lib/diametric/persistence/peer.rb +53 -2
- data/lib/diametric/persistence/rest.rb +27 -1
- data/lib/diametric/query.rb +49 -31
- data/lib/diametric/rest_service.rb +8 -9
- data/lib/diametric/service_base.rb +7 -7
- data/lib/diametric/transactor.rb +6 -5
- data/lib/diametric/version.rb +1 -1
- data/lib/diametric_service.jar +0 -0
- data/spec/config/free-transactor-template.properties +6 -6
- data/spec/developer_query_spec.rb +17 -6
- data/spec/diametric/entity_spec.rb +62 -139
- data/spec/diametric/peer_api_spec.rb +23 -23
- data/spec/diametric/persistence/peer_spec.rb +73 -11
- data/spec/diametric/persistence/rest_spec.rb +108 -16
- data/spec/diametric/query_spec.rb +3 -3
- data/spec/diametric/rest_service_spec.rb +4 -4
- data/spec/diametric/schema_spec.rb +526 -0
- data/spec/diametric/transactor_spec.rb +5 -6
- data/spec/integration_spec.rb +7 -7
- data/spec/peer_integration_spec.rb +25 -1
- data/spec/peer_seattle_spec.rb +1 -2
- data/spec/spec_helper.rb +31 -4
- data/spec/support/cardinarity_many_example.rb +37 -0
- data/spec/support/entities.rb +127 -0
- data/spec/support/has_a_example.rb +31 -0
- data/spec/support/has_many_example.rb +79 -0
- data/spec/support/persistence_examples.rb +13 -5
- data/spec/support/various_types_examples.rb +163 -0
- data/spec/test_version_file.yml +2 -2
- metadata +147 -75
@@ -36,7 +36,7 @@ describe Developer, :jruby => true do
|
|
36
36
|
yoko.save(@conn)
|
37
37
|
query = Diametric::Query.new(Developer, @conn, true).where(:name => "Yoko Harada")
|
38
38
|
query_data = "[:find ?e :in $ [?name] :where [?e :developer/name ?name]]"
|
39
|
-
query.data.first.gsub(" ", "").should == query_data.gsub(" ", "")
|
39
|
+
query.data.first.to_edn.gsub(" ", "").should == query_data.gsub(" ", "")
|
40
40
|
result = query.all
|
41
41
|
result.size.should == 1
|
42
42
|
result.first.nerd_rate.should == 50
|
@@ -57,9 +57,8 @@ describe Developer, :jruby => true do
|
|
57
57
|
|
58
58
|
developer = Developer.reify(result.first.first, @conn.db, false)
|
59
59
|
friends = developer.friends
|
60
|
-
friends.
|
61
|
-
|
62
|
-
end
|
60
|
+
friends.size.should == 1
|
61
|
+
friends.first.should be_a(Diametric::Persistence::Entity)
|
63
62
|
end
|
64
63
|
|
65
64
|
it "should find three developers" do
|
@@ -94,8 +93,8 @@ describe Developer, :jruby => true do
|
|
94
93
|
ryan.save(@conn)
|
95
94
|
|
96
95
|
query = Diametric::Query.new(Developer, @conn).filter(:>, :nerd_rate, 70)
|
97
|
-
query_data = "[:find ?e :in $ [?
|
98
|
-
query.data.first.gsub(" ", "").should == query_data.gsub(" ", "")
|
96
|
+
query_data = "[:find ?e :in $ [?nerd_ratevalue] :where [?e :developer/nerd_rate ?nerd_rate] [(> ?nerd_rate ?nerd_ratevalue)]]"
|
97
|
+
query.data.first.to_edn.gsub(" ", "").should == query_data.gsub(" ", "")
|
99
98
|
result = query.all
|
100
99
|
result.size.should == 2
|
101
100
|
end
|
@@ -117,4 +116,16 @@ describe Developer, :jruby => true do
|
|
117
116
|
result.size.should == 1
|
118
117
|
result.first.friends.collect(&:name).should =~ ["Yoko Harada", "Clinton N. Dreisbach"]
|
119
118
|
end
|
119
|
+
|
120
|
+
it "should not think found objects are dirty" do
|
121
|
+
david = Developer.new
|
122
|
+
david.name = "David Bock"
|
123
|
+
david.nerd_rate = 42
|
124
|
+
david.save(@conn)
|
125
|
+
query = Diametric::Query.new(Developer, @conn)
|
126
|
+
result = query.all
|
127
|
+
developer = Developer.reify(result.first.first, @conn.db, false)
|
128
|
+
developer.changed.should == []
|
129
|
+
end
|
130
|
+
|
120
131
|
end
|
@@ -3,29 +3,6 @@ require 'diametric/entity'
|
|
3
3
|
|
4
4
|
require 'rspec/expectations'
|
5
5
|
|
6
|
-
RSpec::Matchers.define :be_an_equivalent_hash do |expected|
|
7
|
-
match do |actual|
|
8
|
-
status = true
|
9
|
-
expected.each do |k, v|
|
10
|
-
next if k == ":db/id"
|
11
|
-
status = false if actual[k].nil?
|
12
|
-
status = false unless actual[k] == v
|
13
|
-
end
|
14
|
-
status
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
RSpec::Matchers.define :be_an_equivalent_array do |expected|
|
19
|
-
match do |actual|
|
20
|
-
status = true
|
21
|
-
expected.each_with_index do |e, index|
|
22
|
-
next if e == "#db/id[:db.part/user]"
|
23
|
-
status = false unless actual[index] == e
|
24
|
-
end
|
25
|
-
status
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
6
|
describe Diametric::Entity do
|
30
7
|
describe "in a class" do
|
31
8
|
subject { Person }
|
@@ -241,34 +218,18 @@ describe Diametric::Entity do
|
|
241
218
|
subject { Choice }
|
242
219
|
|
243
220
|
it "should generate a schema" do
|
244
|
-
expected = [
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
":db.install/_attribute" => ":db.part/db" }
|
257
|
-
]
|
258
|
-
else
|
259
|
-
expected = [
|
260
|
-
{ :"db/id" => subject.send(:tempid, :"db.part/db"),
|
261
|
-
:"db/ident" => :"choice/item",
|
262
|
-
:"db/valueType" => :"db.type/string",
|
263
|
-
:"db/cardinality" => :"db.cardinality/one",
|
264
|
-
:"db.install/_attribute" => :"db.part/db" },
|
265
|
-
{ :"db/id" => subject.send(:tempid, :"db.part/db"),
|
266
|
-
:"db/ident" => :"choice/checked",
|
267
|
-
:"db/valueType" => :"db.type/boolean",
|
268
|
-
:"db/cardinality" => :"db.cardinality/one",
|
269
|
-
:"db.install/_attribute" => :"db.part/db" }
|
270
|
-
]
|
271
|
-
end
|
221
|
+
expected = [
|
222
|
+
{ :"db/id" => subject.send(:tempid, :"db.part/db"),
|
223
|
+
:"db/ident" => :"choice/item",
|
224
|
+
:"db/valueType" => :"db.type/string",
|
225
|
+
:"db/cardinality" => :"db.cardinality/one",
|
226
|
+
:"db.install/_attribute" => :"db.part/db" },
|
227
|
+
{ :"db/id" => subject.send(:tempid, :"db.part/db"),
|
228
|
+
:"db/ident" => :"choice/checked",
|
229
|
+
:"db/valueType" => :"db.type/boolean",
|
230
|
+
:"db/cardinality" => :"db.cardinality/one",
|
231
|
+
:"db.install/_attribute" => :"db.part/db" }
|
232
|
+
]
|
272
233
|
@created_schema = subject.schema
|
273
234
|
expected.each do |e|
|
274
235
|
@created_schema.shift.should be_an_equivalent_hash(e)
|
@@ -280,34 +241,18 @@ describe Diametric::Entity do
|
|
280
241
|
subject { Customer }
|
281
242
|
|
282
243
|
it "should generate a schema" do
|
283
|
-
expected = [
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
":db.install/_attribute" => ":db.part/db" }
|
296
|
-
]
|
297
|
-
else
|
298
|
-
expected = [
|
299
|
-
{ :"db/id" => subject.send(:tempid, :"db.part/db"),
|
300
|
-
:"db/ident" => :"customer/name",
|
301
|
-
:"db/valueType" => :"db.type/string",
|
302
|
-
:"db/cardinality" => :"db.cardinality/one",
|
303
|
-
:"db.install/_attribute" => :"db.part/db" },
|
304
|
-
{ :"db/id" => subject.send(:tempid, :"db.part/db"),
|
305
|
-
:"db/ident" => :"customer/id",
|
306
|
-
:"db/valueType" => :"db.type/uuid",
|
307
|
-
:"db/cardinality" => :"db.cardinality/one",
|
308
|
-
:"db.install/_attribute" => :"db.part/db" }
|
309
|
-
]
|
310
|
-
end
|
244
|
+
expected = [
|
245
|
+
{ :"db/id" => subject.send(:tempid, :"db.part/db"),
|
246
|
+
:"db/ident" => :"customer/name",
|
247
|
+
:"db/valueType" => :"db.type/string",
|
248
|
+
:"db/cardinality" => :"db.cardinality/one",
|
249
|
+
:"db.install/_attribute" => :"db.part/db" },
|
250
|
+
{ :"db/id" => subject.send(:tempid, :"db.part/db"),
|
251
|
+
:"db/ident" => :"customer/id",
|
252
|
+
:"db/valueType" => :"db.type/uuid",
|
253
|
+
:"db/cardinality" => :"db.cardinality/one",
|
254
|
+
:"db.install/_attribute" => :"db.part/db" }
|
255
|
+
]
|
311
256
|
@created_schema = subject.schema
|
312
257
|
expected.each do |e|
|
313
258
|
@created_schema.shift.should be_an_equivalent_hash(e)
|
@@ -319,44 +264,23 @@ describe Diametric::Entity do
|
|
319
264
|
subject { Account }
|
320
265
|
|
321
266
|
it "should generate a schema" do
|
322
|
-
expected = [
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
":db.install/_attribute" => ":db.part/db" }
|
340
|
-
]
|
341
|
-
else
|
342
|
-
expected = [
|
343
|
-
{ :"db/id" => subject.send(:tempid, :"db.part/db"),
|
344
|
-
:"db/ident" => :"account/name",
|
345
|
-
:"db/valueType" => :"db.type/string",
|
346
|
-
:"db/cardinality" => :"db.cardinality/one",
|
347
|
-
:"db.install/_attribute" => :"db.part/db" },
|
348
|
-
{ :"db/id" => subject.send(:tempid, :"db.part/db"),
|
349
|
-
:"db/ident" => :"account/deposit",
|
350
|
-
:"db/valueType" => :"db.type/double",
|
351
|
-
:"db/cardinality" => :"db.cardinality/many",
|
352
|
-
:"db.install/_attribute" => :"db.part/db" },
|
353
|
-
{ :"db/id" => subject.send(:tempid, :"db.part/db"),
|
354
|
-
:"db/ident" => :"account/amount",
|
355
|
-
:"db/valueType" => :"db.type/double",
|
356
|
-
:"db/cardinality" => :"db.cardinality/one",
|
357
|
-
:"db.install/_attribute" => :"db.part/db" }
|
358
|
-
]
|
359
|
-
end
|
267
|
+
expected = [
|
268
|
+
{ :"db/id" => subject.send(:tempid, :"db.part/db"),
|
269
|
+
:"db/ident" => :"account/name",
|
270
|
+
:"db/valueType" => :"db.type/string",
|
271
|
+
:"db/cardinality" => :"db.cardinality/one",
|
272
|
+
:"db.install/_attribute" => :"db.part/db" },
|
273
|
+
{ :"db/id" => subject.send(:tempid, :"db.part/db"),
|
274
|
+
:"db/ident" => :"account/deposit",
|
275
|
+
:"db/valueType" => :"db.type/double",
|
276
|
+
:"db/cardinality" => :"db.cardinality/many",
|
277
|
+
:"db.install/_attribute" => :"db.part/db" },
|
278
|
+
{ :"db/id" => subject.send(:tempid, :"db.part/db"),
|
279
|
+
:"db/ident" => :"account/amount",
|
280
|
+
:"db/valueType" => :"db.type/double",
|
281
|
+
:"db/cardinality" => :"db.cardinality/one",
|
282
|
+
:"db.install/_attribute" => :"db.part/db" }
|
283
|
+
]
|
360
284
|
@created_schema = subject.schema
|
361
285
|
expected.each do |e|
|
362
286
|
@created_schema.shift.should be_an_equivalent_hash(e)
|
@@ -439,27 +363,27 @@ describe Diametric::Entity do
|
|
439
363
|
|
440
364
|
it "should create peer schema" do
|
441
365
|
expected = [
|
442
|
-
{ "
|
443
|
-
"
|
444
|
-
"
|
445
|
-
"
|
446
|
-
"
|
447
|
-
"
|
448
|
-
"
|
449
|
-
{ "
|
450
|
-
"
|
451
|
-
"
|
452
|
-
"
|
453
|
-
"
|
454
|
-
"
|
455
|
-
[ "
|
456
|
-
[ "
|
457
|
-
[ "
|
458
|
-
[ "
|
459
|
-
[ "
|
460
|
-
[ "
|
461
|
-
[ "
|
462
|
-
[ "
|
366
|
+
{ :"db/id" => subject.send(:tempid, :"db.part/db"),
|
367
|
+
:"db/ident" => :"district/name",
|
368
|
+
:"db/valueType" => :"db.type/string",
|
369
|
+
:"db/cardinality" => :"db.cardinality/one",
|
370
|
+
:"db/unique" => :"db.unique/identity",
|
371
|
+
:"db/doc" => "A unique district name (upsertable)",
|
372
|
+
:"db.install/_attribute" => :"db.part/db" },
|
373
|
+
{ :"db/id" => subject.send(:tempid, :"db.part/db"),
|
374
|
+
:"db/ident" => :"district/region",
|
375
|
+
:"db/valueType" => :"db.type/ref",
|
376
|
+
:"db/cardinality" => :"db.cardinality/one",
|
377
|
+
:"db/doc" => "A district region enum value",
|
378
|
+
:"db.install/_attribute" => :"db.part/db" },
|
379
|
+
[ :"db/add", "#db/id[:db.part/user]", :"db/ident", :"district.region/n"],
|
380
|
+
[ :"db/add", "#db/id[:db.part/user]", :"db/ident", :"district.region/ne"],
|
381
|
+
[ :"db/add", "#db/id[:db.part/user]", :"db/ident", :"district.region/e"],
|
382
|
+
[ :"db/add", "#db/id[:db.part/user]", :"db/ident", :"district.region/se"],
|
383
|
+
[ :"db/add", "#db/id[:db.part/user]", :"db/ident", :"district.region/s"],
|
384
|
+
[ :"db/add", "#db/id[:db.part/user]", :"db/ident", :"district.region/sw"],
|
385
|
+
[ :"db/add", "#db/id[:db.part/user]", :"db/ident", :"district.region/w"],
|
386
|
+
[ :"db/add", "#db/id[:db.part/user]", :"db/ident", :"district.region/nw"]
|
463
387
|
]
|
464
388
|
@created_schema = District.schema
|
465
389
|
expected.each do |e|
|
@@ -472,5 +396,4 @@ describe Diametric::Entity do
|
|
472
396
|
end
|
473
397
|
end
|
474
398
|
end
|
475
|
-
|
476
399
|
end
|
@@ -15,9 +15,9 @@ if is_jruby?
|
|
15
15
|
end
|
16
16
|
|
17
17
|
it 'should get tempid' do
|
18
|
-
subject.tempid("
|
19
|
-
subject.tempid("
|
20
|
-
subject.tempid("
|
18
|
+
subject.tempid(:"db.part/db").to_s.should match(/#db\/id\[:db.part\/db\s-\d+\]/)
|
19
|
+
subject.tempid(:"db.part/user").to_s.should match(/#db\/id\[:db.part\/user\s-\d+\]/)
|
20
|
+
subject.tempid(:"db.part/user", -1).to_s.should match(/#db\/id\[:db.part\/user\s-1\]/)
|
21
21
|
end
|
22
22
|
|
23
23
|
it "should return uuid from squuid" do
|
@@ -34,21 +34,21 @@ if is_jruby?
|
|
34
34
|
context Diametric::Persistence::Connection do
|
35
35
|
@db_name = "test-#{SecureRandom.uuid}"
|
36
36
|
let(:connection) { Diametric::Persistence::Peer.connect("datomic:mem://#{@db_name}") }
|
37
|
-
let(:tempid) { Diametric::Persistence::Peer.tempid("
|
37
|
+
let(:tempid) { Diametric::Persistence::Peer.tempid(:"db.part/db") }
|
38
38
|
let(:tx_data) {
|
39
39
|
[{
|
40
|
-
"
|
41
|
-
"
|
42
|
-
"
|
43
|
-
"
|
44
|
-
"
|
45
|
-
"
|
40
|
+
:"db/id" => tempid,
|
41
|
+
:"db/ident" => :"person/name",
|
42
|
+
:"db/valueType" => :"db.type/string",
|
43
|
+
:"db/cardinality" => :"db.cardinality/one",
|
44
|
+
:"db/doc" => "A person's name",
|
45
|
+
:"db.install/_attribute" => :"db.part/db"
|
46
46
|
}]
|
47
47
|
}
|
48
48
|
let(:user_data) {
|
49
|
-
[{"
|
50
|
-
{"
|
51
|
-
{"
|
49
|
+
[{:"db/id" => user_part_tempid, :"person/name" => "Alice"},
|
50
|
+
{:"db/id" => user_part_tempid, :"person/name" => "Bob"},
|
51
|
+
{:"db/id" => user_part_tempid, :"person/name" => "Chris"}]
|
52
52
|
}
|
53
53
|
|
54
54
|
it 'should transact schema' do
|
@@ -79,17 +79,17 @@ if is_jruby?
|
|
79
79
|
before do
|
80
80
|
tx_data =
|
81
81
|
[{
|
82
|
-
"
|
83
|
-
"
|
84
|
-
"
|
85
|
-
"
|
86
|
-
"
|
87
|
-
"
|
82
|
+
:"db/id" => Diametric::Persistence::Peer.tempid(:"db.part/db"),
|
83
|
+
:"db/ident" => :"person/name",
|
84
|
+
:"db/valueType" => :"db.type/string",
|
85
|
+
:"db/cardinality" => :"db.cardinality/one",
|
86
|
+
:"db/doc" => "A person's name",
|
87
|
+
:"db.install/_attribute" => :"db.part/db"
|
88
88
|
}]
|
89
89
|
user_data =
|
90
|
-
[{"
|
91
|
-
{"
|
92
|
-
{"
|
90
|
+
[{:"db/id" => Diametric::Persistence::Peer.tempid(:"db.part/user"), :"person/name" => "Alice"},
|
91
|
+
{:"db/id" => Diametric::Persistence::Peer.tempid(:"db.part/user"), :"person/name" => "Bob"},
|
92
|
+
{:"db/id" => Diametric::Persistence::Peer.tempid(:"db.part/user"), :"person/name" => "Chris"}]
|
93
93
|
@db_name = "test-#{SecureRandom.uuid}"
|
94
94
|
@connection = Diametric::Persistence::Peer.connect("datomic:mem://#{@db_name}")
|
95
95
|
|
@@ -560,5 +560,5 @@ if is_jruby?
|
|
560
560
|
end
|
561
561
|
|
562
562
|
def user_part_tempid
|
563
|
-
Diametric::Persistence::Peer.tempid("
|
563
|
+
Diametric::Persistence::Peer.tempid(:"db.part/user")
|
564
564
|
end
|
@@ -2,26 +2,88 @@ require 'spec_helper'
|
|
2
2
|
require 'diametric/persistence/peer'
|
3
3
|
require 'securerandom'
|
4
4
|
|
5
|
-
describe Diametric::Persistence::Peer, :jruby do
|
6
|
-
|
7
|
-
|
5
|
+
describe Diametric::Persistence::Peer, :integration => true, :jruby => true do
|
6
|
+
context Rat do
|
7
|
+
before do
|
8
|
+
datomic_uri = "datomic:mem://rat-#{SecureRandom.uuid}"
|
9
|
+
@conn = Diametric::Persistence::Peer.connect(datomic_uri)
|
10
|
+
Rat.create_schema(@conn).get
|
11
|
+
end
|
12
|
+
|
13
|
+
after do
|
14
|
+
@conn.release
|
15
|
+
end
|
16
|
+
|
17
|
+
it_behaves_like "persistence API" do
|
18
|
+
let(:model_class) { Rat }
|
19
|
+
end
|
8
20
|
end
|
9
21
|
|
10
|
-
|
11
|
-
|
12
|
-
|
22
|
+
context ScarletMacaw do
|
23
|
+
before do
|
24
|
+
datomic_uri = "datomic:mem://scarlet-macaw-#{SecureRandom.uuid}"
|
25
|
+
@conn = Diametric::Persistence::Peer.connect(datomic_uri)
|
26
|
+
ScarletMacaw.create_schema(@conn).get
|
27
|
+
end
|
28
|
+
|
29
|
+
after do
|
30
|
+
@conn.release
|
31
|
+
end
|
32
|
+
|
33
|
+
it_behaves_like "supports various types" do
|
34
|
+
let(:model_class) { ScarletMacaw }
|
35
|
+
end
|
13
36
|
end
|
14
37
|
|
15
|
-
|
16
|
-
|
38
|
+
context MyWords do
|
39
|
+
before do
|
40
|
+
datomic_uri = "datomic:mem://my-words-#{SecureRandom.uuid}"
|
41
|
+
@conn = Diametric::Persistence::Peer.connect(datomic_uri)
|
42
|
+
MyWords.create_schema(@conn).get
|
43
|
+
end
|
17
44
|
|
45
|
+
after do
|
46
|
+
@conn.release
|
47
|
+
end
|
48
|
+
|
49
|
+
it_behaves_like "supports cardinality many" do
|
50
|
+
let(:model_class) { MyWords }
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
context Cage do
|
55
|
+
before do
|
56
|
+
datomic_uri = "datomic:mem://cage-#{SecureRandom.uuid}"
|
57
|
+
@conn = Diametric::Persistence::Peer.connect(datomic_uri)
|
58
|
+
Cage.create_schema(@conn).get
|
59
|
+
Rat.create_schema(@conn).get
|
60
|
+
end
|
61
|
+
|
62
|
+
after do
|
63
|
+
@conn.release
|
64
|
+
end
|
65
|
+
|
66
|
+
it_behaves_like "supports has_one association" do
|
67
|
+
let(:parent_class) { Cage }
|
68
|
+
let(:child_class) { Rat }
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
context BigCage do
|
18
73
|
before do
|
19
|
-
|
20
|
-
Diametric::Persistence::Peer.
|
74
|
+
datomic_uri = "datomic:mem://big-cage-#{SecureRandom.uuid}"
|
75
|
+
@conn = Diametric::Persistence::Peer.connect(datomic_uri)
|
76
|
+
BigCage.create_schema(@conn).get
|
77
|
+
Rat.create_schema(@conn).get
|
21
78
|
end
|
22
79
|
|
23
80
|
after do
|
24
|
-
@
|
81
|
+
@conn.release
|
82
|
+
end
|
83
|
+
|
84
|
+
it_behaves_like "supporting has_many association" do
|
85
|
+
let(:parent_class) { BigCage }
|
86
|
+
let(:child_class) { Rat }
|
25
87
|
end
|
26
88
|
end
|
27
89
|
end
|