cuprum-collections 0.4.0 → 0.5.0
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/CHANGELOG.md +73 -0
- data/README.md +5 -5
- data/lib/cuprum/collections/association.rb +9 -28
- data/lib/cuprum/collections/associations/belongs_to.rb +1 -8
- data/lib/cuprum/collections/associations/has_many.rb +1 -10
- data/lib/cuprum/collections/associations/has_one.rb +1 -10
- data/lib/cuprum/collections/basic/collection.rb +56 -49
- data/lib/cuprum/collections/basic/command.rb +22 -88
- data/lib/cuprum/collections/basic/commands/assign_one.rb +2 -6
- data/lib/cuprum/collections/basic/commands/build_one.rb +1 -4
- data/lib/cuprum/collections/basic/commands/destroy_one.rb +4 -8
- data/lib/cuprum/collections/basic/commands/find_many.rb +4 -24
- data/lib/cuprum/collections/basic/commands/find_matching.rb +5 -21
- data/lib/cuprum/collections/basic/commands/find_one.rb +3 -20
- data/lib/cuprum/collections/basic/commands/insert_one.rb +3 -6
- data/lib/cuprum/collections/basic/commands/update_one.rb +3 -6
- data/lib/cuprum/collections/basic/commands/validate_one.rb +13 -18
- data/lib/cuprum/collections/basic/query.rb +26 -40
- data/lib/cuprum/collections/basic/repository.rb +4 -3
- data/lib/cuprum/collections/basic/scopes/all_scope.rb +25 -0
- data/lib/cuprum/collections/basic/scopes/base.rb +32 -0
- data/lib/cuprum/collections/basic/scopes/builder.rb +39 -0
- data/lib/cuprum/collections/basic/scopes/conjunction_scope.rb +20 -0
- data/lib/cuprum/collections/basic/scopes/criteria_scope.rb +62 -0
- data/lib/cuprum/collections/basic/scopes/disjunction_scope.rb +20 -0
- data/lib/cuprum/collections/basic/scopes/none_scope.rb +33 -0
- data/lib/cuprum/collections/basic/scopes.rb +23 -0
- data/lib/cuprum/collections/basic.rb +1 -0
- data/lib/cuprum/collections/collection.rb +24 -82
- data/lib/cuprum/collections/collection_command.rb +116 -0
- data/lib/cuprum/collections/commands/abstract_find_many.rb +11 -21
- data/lib/cuprum/collections/commands/abstract_find_matching.rb +43 -24
- data/lib/cuprum/collections/commands/abstract_find_one.rb +7 -10
- data/lib/cuprum/collections/commands/associations/find_many.rb +3 -8
- data/lib/cuprum/collections/commands/associations/require_many.rb +5 -5
- data/lib/cuprum/collections/commands/create.rb +3 -3
- data/lib/cuprum/collections/commands/find_one_matching.rb +6 -6
- data/lib/cuprum/collections/commands/query_command.rb +19 -0
- data/lib/cuprum/collections/commands/update.rb +3 -3
- data/lib/cuprum/collections/commands/upsert.rb +10 -10
- data/lib/cuprum/collections/commands.rb +1 -0
- data/lib/cuprum/collections/constraints/ordering.rb +2 -2
- data/lib/cuprum/collections/errors/abstract_find_error.rb +25 -42
- data/lib/cuprum/collections/errors/extra_attributes.rb +3 -3
- data/lib/cuprum/collections/errors/failed_validation.rb +2 -2
- data/lib/cuprum/collections/errors/invalid_parameters.rb +2 -2
- data/lib/cuprum/collections/errors/invalid_query.rb +10 -16
- data/lib/cuprum/collections/errors/missing_default_contract.rb +1 -1
- data/lib/cuprum/collections/errors/unknown_operator.rb +1 -1
- data/lib/cuprum/collections/queries.rb +31 -0
- data/lib/cuprum/collections/query.rb +50 -62
- data/lib/cuprum/collections/relation.rb +5 -383
- data/lib/cuprum/collections/relations/cardinality.rb +66 -0
- data/lib/cuprum/collections/relations/options.rb +18 -0
- data/lib/cuprum/collections/relations/parameters.rb +217 -0
- data/lib/cuprum/collections/relations/primary_keys.rb +23 -0
- data/lib/cuprum/collections/relations/scope.rb +65 -0
- data/lib/cuprum/collections/relations.rb +14 -0
- data/lib/cuprum/collections/repository.rb +5 -5
- data/lib/cuprum/collections/resource.rb +10 -41
- data/lib/cuprum/collections/rspec/contracts/association_contracts.rb +80 -90
- data/lib/cuprum/collections/rspec/contracts/collection_contracts.rb +69 -111
- data/lib/cuprum/collections/rspec/contracts/command_contracts.rb +42 -1335
- data/lib/cuprum/collections/rspec/contracts/query_contracts.rb +352 -531
- data/lib/cuprum/collections/rspec/contracts/relation_contracts.rb +74 -191
- data/lib/cuprum/collections/rspec/contracts/repository_contracts.rb +13 -13
- data/lib/cuprum/collections/rspec/contracts/scope_contracts.rb +1029 -0
- data/lib/cuprum/collections/rspec/contracts/scopes/builder_contracts.rb +856 -0
- data/lib/cuprum/collections/rspec/contracts/scopes/composition_contracts.rb +1430 -0
- data/lib/cuprum/collections/rspec/contracts/scopes/criteria_contracts.rb +2217 -0
- data/lib/cuprum/collections/rspec/contracts/scopes/logical_contracts.rb +297 -0
- data/lib/cuprum/collections/rspec/contracts/scopes.rb +13 -0
- data/lib/cuprum/collections/rspec/contracts.rb +2 -0
- data/lib/cuprum/collections/rspec/deferred/association_examples.rb +2098 -0
- data/lib/cuprum/collections/rspec/deferred/collection_examples.rb +338 -0
- data/lib/cuprum/collections/rspec/deferred/command_examples.rb +160 -0
- data/lib/cuprum/collections/rspec/deferred/commands/assign_one_examples.rb +178 -0
- data/lib/cuprum/collections/rspec/deferred/commands/build_one_examples.rb +94 -0
- data/lib/cuprum/collections/rspec/deferred/commands/destroy_one_examples.rb +118 -0
- data/lib/cuprum/collections/rspec/deferred/commands/find_many_examples.rb +307 -0
- data/lib/cuprum/collections/rspec/deferred/commands/find_matching_examples.rb +143 -0
- data/lib/cuprum/collections/rspec/deferred/commands/find_one_examples.rb +116 -0
- data/lib/cuprum/collections/rspec/deferred/commands/insert_one_examples.rb +103 -0
- data/lib/cuprum/collections/rspec/deferred/commands/update_one_examples.rb +99 -0
- data/lib/cuprum/collections/rspec/deferred/commands/validate_one_examples.rb +117 -0
- data/lib/cuprum/collections/rspec/deferred/commands.rb +8 -0
- data/lib/cuprum/collections/rspec/deferred/relation_examples.rb +1437 -0
- data/lib/cuprum/collections/rspec/deferred/resource_examples.rb +26 -0
- data/lib/cuprum/collections/rspec/deferred.rb +8 -0
- data/lib/cuprum/collections/scope.rb +29 -0
- data/lib/cuprum/collections/scopes/all.rb +51 -0
- data/lib/cuprum/collections/scopes/all_scope.rb +18 -0
- data/lib/cuprum/collections/scopes/base.rb +79 -0
- data/lib/cuprum/collections/scopes/builder.rb +39 -0
- data/lib/cuprum/collections/scopes/building.rb +221 -0
- data/lib/cuprum/collections/scopes/composition.rb +162 -0
- data/lib/cuprum/collections/scopes/conjunction.rb +44 -0
- data/lib/cuprum/collections/scopes/conjunction_scope.rb +12 -0
- data/lib/cuprum/collections/scopes/container.rb +65 -0
- data/lib/cuprum/collections/scopes/criteria/parser.rb +241 -0
- data/lib/cuprum/collections/scopes/criteria.rb +206 -0
- data/lib/cuprum/collections/scopes/criteria_scope.rb +12 -0
- data/lib/cuprum/collections/scopes/disjunction.rb +45 -0
- data/lib/cuprum/collections/scopes/disjunction_scope.rb +12 -0
- data/lib/cuprum/collections/scopes/none.rb +62 -0
- data/lib/cuprum/collections/scopes/none_scope.rb +18 -0
- data/lib/cuprum/collections/scopes.rb +23 -0
- data/lib/cuprum/collections/version.rb +2 -2
- data/lib/cuprum/collections.rb +14 -9
- metadata +61 -15
- data/lib/cuprum/collections/basic/query_builder.rb +0 -69
- data/lib/cuprum/collections/command.rb +0 -26
- data/lib/cuprum/collections/queries/parse.rb +0 -22
- data/lib/cuprum/collections/queries/parse_block.rb +0 -206
- data/lib/cuprum/collections/queries/parse_strategy.rb +0 -91
- data/lib/cuprum/collections/query_builder.rb +0 -61
- data/lib/cuprum/collections/rspec/contracts/basic/command_contracts.rb +0 -484
@@ -5,6 +5,9 @@ require 'cuprum/collections/rspec/contracts/relation_contracts'
|
|
5
5
|
|
6
6
|
module Cuprum::Collections::RSpec::Contracts
|
7
7
|
# Contracts for asserting on Association objects.
|
8
|
+
#
|
9
|
+
# @deprecated 0.5.0 Association contracts are deprecated. Use
|
10
|
+
# Deferred::AssociationExamples instead.
|
8
11
|
module AssociationContracts
|
9
12
|
# Contract validating the behavior of an Association.
|
10
13
|
module ShouldBeAnAssociationContract
|
@@ -24,19 +27,6 @@ module Cuprum::Collections::RSpec::Contracts
|
|
24
27
|
|
25
28
|
include_contract 'should be a relation'
|
26
29
|
|
27
|
-
include_contract 'should disambiguate parameter',
|
28
|
-
:entity_class,
|
29
|
-
as: %i[association_class resource_class],
|
30
|
-
value: Grimoire
|
31
|
-
|
32
|
-
include_contract 'should disambiguate parameter',
|
33
|
-
:name,
|
34
|
-
as: %i[association_name resource_name]
|
35
|
-
|
36
|
-
include_contract 'should disambiguate parameter',
|
37
|
-
:singular_name,
|
38
|
-
as: :singular_resource_name
|
39
|
-
|
40
30
|
include_contract 'should define primary keys'
|
41
31
|
|
42
32
|
describe '#build_entities_query' do
|
@@ -67,7 +57,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
67
57
|
context 'when initialized with inverse: value' do
|
68
58
|
let(:inverse) { described_class.new(name: 'authors') }
|
69
59
|
let(:constructor_options) do
|
70
|
-
super().merge(inverse:
|
60
|
+
super().merge(inverse:)
|
71
61
|
end
|
72
62
|
|
73
63
|
it { expect(subject.inverse).to be == inverse }
|
@@ -83,7 +73,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
83
73
|
context 'when initialized with inverse: value' do
|
84
74
|
let(:inverse) { described_class.new(name: 'authors') }
|
85
75
|
let(:constructor_options) do
|
86
|
-
super().merge(inverse:
|
76
|
+
super().merge(inverse:)
|
87
77
|
end
|
88
78
|
|
89
79
|
it { expect(subject.inverse).to be == new_inverse }
|
@@ -97,7 +87,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
97
87
|
context 'when initialized with inverse: value' do
|
98
88
|
let(:inverse) { described_class.new(name: 'authors') }
|
99
89
|
let(:constructor_options) do
|
100
|
-
super().merge(inverse:
|
90
|
+
super().merge(inverse:)
|
101
91
|
end
|
102
92
|
|
103
93
|
it { expect(subject.inverse_class).to be == Author }
|
@@ -163,7 +153,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
163
153
|
context 'when initialized with inverse: value' do
|
164
154
|
let(:inverse) { described_class.new(name: 'authors') }
|
165
155
|
let(:constructor_options) do
|
166
|
-
super().merge(inverse:
|
156
|
+
super().merge(inverse:)
|
167
157
|
end
|
168
158
|
|
169
159
|
it { expect(subject.inverse_class).to be == Chapter }
|
@@ -181,7 +171,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
181
171
|
context 'when initialized with inverse: value' do
|
182
172
|
let(:inverse) { described_class.new(name: 'authors') }
|
183
173
|
let(:constructor_options) do
|
184
|
-
super().merge(inverse:
|
174
|
+
super().merge(inverse:)
|
185
175
|
end
|
186
176
|
|
187
177
|
it { expect(subject.inverse_name).to be == 'authors' }
|
@@ -231,7 +221,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
231
221
|
context 'when initialized with inverse: value' do
|
232
222
|
let(:inverse) { described_class.new(name: 'authors') }
|
233
223
|
let(:constructor_options) do
|
234
|
-
super().merge(inverse:
|
224
|
+
super().merge(inverse:)
|
235
225
|
end
|
236
226
|
|
237
227
|
it { expect(subject.inverse_name).to be == 'chapters' }
|
@@ -268,7 +258,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
268
258
|
context 'when initialized with inverse: value' do
|
269
259
|
let(:inverse) { described_class.new(name: 'authors') }
|
270
260
|
let(:constructor_options) do
|
271
|
-
super().merge(inverse:
|
261
|
+
super().merge(inverse:)
|
272
262
|
end
|
273
263
|
|
274
264
|
it { expect(subject.options).to be == {} }
|
@@ -293,7 +283,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
293
283
|
context 'when initialized with inverse: value' do
|
294
284
|
let(:inverse) { described_class.new(name: 'authors') }
|
295
285
|
let(:constructor_options) do
|
296
|
-
super().merge(inverse:
|
286
|
+
super().merge(inverse:)
|
297
287
|
end
|
298
288
|
|
299
289
|
it { expect(subject.singular_inverse_name).to be == 'author' }
|
@@ -301,7 +291,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
301
291
|
context 'when initialized with singular_inverse_name: a String' do
|
302
292
|
let(:singular_inverse_name) { 'writer' }
|
303
293
|
let(:constructor_options) do
|
304
|
-
super().merge(singular_inverse_name:
|
294
|
+
super().merge(singular_inverse_name:)
|
305
295
|
end
|
306
296
|
|
307
297
|
it { expect(subject.singular_inverse_name).to be == 'writer' }
|
@@ -310,7 +300,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
310
300
|
context 'when initialized with singular_inverse_name: a Symbol' do
|
311
301
|
let(:singular_inverse_name) { :writer }
|
312
302
|
let(:constructor_options) do
|
313
|
-
super().merge(singular_inverse_name:
|
303
|
+
super().merge(singular_inverse_name:)
|
314
304
|
end
|
315
305
|
|
316
306
|
it { expect(subject.singular_inverse_name).to be == 'writer' }
|
@@ -320,7 +310,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
320
310
|
context 'when initialized with inverse_name: value' do
|
321
311
|
let(:inverse_name) { 'authors' }
|
322
312
|
let(:constructor_options) do
|
323
|
-
super().merge(inverse_name:
|
313
|
+
super().merge(inverse_name:)
|
324
314
|
end
|
325
315
|
|
326
316
|
it { expect(subject.singular_inverse_name).to be == 'author' }
|
@@ -328,7 +318,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
328
318
|
context 'when initialized with singular_inverse_name: a String' do
|
329
319
|
let(:singular_inverse_name) { 'writer' }
|
330
320
|
let(:constructor_options) do
|
331
|
-
super().merge(singular_inverse_name:
|
321
|
+
super().merge(singular_inverse_name:)
|
332
322
|
end
|
333
323
|
|
334
324
|
it { expect(subject.singular_inverse_name).to be == 'writer' }
|
@@ -337,7 +327,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
337
327
|
context 'when initialized with singular_inverse_name: a Symbol' do
|
338
328
|
let(:singular_inverse_name) { :writer }
|
339
329
|
let(:constructor_options) do
|
340
|
-
super().merge(singular_inverse_name:
|
330
|
+
super().merge(singular_inverse_name:)
|
341
331
|
end
|
342
332
|
|
343
333
|
it { expect(subject.singular_inverse_name).to be == 'writer' }
|
@@ -347,7 +337,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
347
337
|
context 'when initialized with singular_inverse_name: a String' do
|
348
338
|
let(:singular_inverse_name) { 'writer' }
|
349
339
|
let(:constructor_options) do
|
350
|
-
super().merge(singular_inverse_name:
|
340
|
+
super().merge(singular_inverse_name:)
|
351
341
|
end
|
352
342
|
|
353
343
|
it { expect(subject.singular_inverse_name).to be == 'writer' }
|
@@ -356,7 +346,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
356
346
|
context 'when initialized with singular_inverse_name: a Symbol' do
|
357
347
|
let(:singular_inverse_name) { :writer }
|
358
348
|
let(:constructor_options) do
|
359
|
-
super().merge(singular_inverse_name:
|
349
|
+
super().merge(singular_inverse_name:)
|
360
350
|
end
|
361
351
|
|
362
352
|
it { expect(subject.singular_inverse_name).to be == 'writer' }
|
@@ -374,7 +364,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
374
364
|
context 'when initialized with inverse: value' do
|
375
365
|
let(:inverse) { described_class.new(name: 'authors') }
|
376
366
|
let(:constructor_options) do
|
377
|
-
super().merge(inverse:
|
367
|
+
super().merge(inverse:)
|
378
368
|
end
|
379
369
|
|
380
370
|
it { expect(subject.singular_inverse_name).to be == 'chapter' }
|
@@ -383,7 +373,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
383
373
|
context 'when initialized with inverse_name: value' do
|
384
374
|
let(:inverse_name) { 'authors' }
|
385
375
|
let(:constructor_options) do
|
386
|
-
super().merge(inverse_name:
|
376
|
+
super().merge(inverse_name:)
|
387
377
|
end
|
388
378
|
|
389
379
|
it { expect(subject.singular_inverse_name).to be == 'chapter' }
|
@@ -391,7 +381,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
391
381
|
context 'when initialized with singular_inverse_name: a String' do
|
392
382
|
let(:singular_inverse_name) { 'writer' }
|
393
383
|
let(:constructor_options) do
|
394
|
-
super().merge(singular_inverse_name:
|
384
|
+
super().merge(singular_inverse_name:)
|
395
385
|
end
|
396
386
|
|
397
387
|
it { expect(subject.singular_inverse_name).to be == 'writer' }
|
@@ -400,7 +390,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
400
390
|
context 'when initialized with singular_inverse_name: a Symbol' do
|
401
391
|
let(:singular_inverse_name) { :writer }
|
402
392
|
let(:constructor_options) do
|
403
|
-
super().merge(singular_inverse_name:
|
393
|
+
super().merge(singular_inverse_name:)
|
404
394
|
end
|
405
395
|
|
406
396
|
it { expect(subject.singular_inverse_name).to be == 'writer' }
|
@@ -410,7 +400,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
410
400
|
context 'when initialized with singular_inverse_name: a String' do
|
411
401
|
let(:singular_inverse_name) { 'writer' }
|
412
402
|
let(:constructor_options) do
|
413
|
-
super().merge(singular_inverse_name:
|
403
|
+
super().merge(singular_inverse_name:)
|
414
404
|
end
|
415
405
|
|
416
406
|
it { expect(subject.singular_inverse_name).to be == 'writer' }
|
@@ -419,7 +409,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
419
409
|
context 'when initialized with singular_inverse_name: a Symbol' do
|
420
410
|
let(:singular_inverse_name) { :writer }
|
421
411
|
let(:constructor_options) do
|
422
|
-
super().merge(singular_inverse_name:
|
412
|
+
super().merge(singular_inverse_name:)
|
423
413
|
end
|
424
414
|
|
425
415
|
it { expect(subject.singular_inverse_name).to be == 'writer' }
|
@@ -472,7 +462,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
472
462
|
association.build_entities_query(*entities, **options)
|
473
463
|
end
|
474
464
|
let(:evaluated) do
|
475
|
-
Spec::QueryBuilder.new
|
465
|
+
query.call(Spec::QueryBuilder.new)
|
476
466
|
end
|
477
467
|
|
478
468
|
example_class 'Spec::Entity' do |klass|
|
@@ -643,7 +633,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
643
633
|
association.build_keys_query(*keys, **options)
|
644
634
|
end
|
645
635
|
let(:evaluated) do
|
646
|
-
Spec::QueryBuilder.new
|
636
|
+
query.call(Spec::QueryBuilder.new)
|
647
637
|
end
|
648
638
|
|
649
639
|
example_class 'Spec::QueryBuilder' do |klass|
|
@@ -728,7 +718,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
728
718
|
context 'when initialized with foreign_key_name: a String' do
|
729
719
|
let(:foreign_key_name) { 'writer_id' }
|
730
720
|
let(:constructor_options) do
|
731
|
-
super().merge(foreign_key_name:
|
721
|
+
super().merge(foreign_key_name:)
|
732
722
|
end
|
733
723
|
|
734
724
|
it { expect(subject.foreign_key_name).to be == 'writer_id' }
|
@@ -737,7 +727,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
737
727
|
context 'when initialized with foreign_key_name: a String' do
|
738
728
|
let(:foreign_key_name) { :writer_id }
|
739
729
|
let(:constructor_options) do
|
740
|
-
super().merge(foreign_key_name:
|
730
|
+
super().merge(foreign_key_name:)
|
741
731
|
end
|
742
732
|
|
743
733
|
it { expect(subject.foreign_key_name).to be == 'writer_id' }
|
@@ -746,7 +736,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
746
736
|
context 'when initialized with singular_name: value' do
|
747
737
|
let(:singular_name) { 'author' }
|
748
738
|
let(:constructor_options) do
|
749
|
-
super().merge(singular_name:
|
739
|
+
super().merge(singular_name:)
|
750
740
|
end
|
751
741
|
|
752
742
|
it { expect(subject.foreign_key_name).to be == 'author_id' }
|
@@ -754,7 +744,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
754
744
|
context 'when initialized with foreign_key_name: a String' do
|
755
745
|
let(:foreign_key_name) { 'writer_id' }
|
756
746
|
let(:constructor_options) do
|
757
|
-
super().merge(foreign_key_name:
|
747
|
+
super().merge(foreign_key_name:)
|
758
748
|
end
|
759
749
|
|
760
750
|
it { expect(subject.foreign_key_name).to be == 'writer_id' }
|
@@ -763,7 +753,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
763
753
|
context 'when initialized with foreign_key_name: a String' do
|
764
754
|
let(:foreign_key_name) { :writer_id }
|
765
755
|
let(:constructor_options) do
|
766
|
-
super().merge(foreign_key_name:
|
756
|
+
super().merge(foreign_key_name:)
|
767
757
|
end
|
768
758
|
|
769
759
|
it { expect(subject.foreign_key_name).to be == 'writer_id' }
|
@@ -783,7 +773,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
783
773
|
context 'when initialized with foreign_key_name: a String' do
|
784
774
|
let(:foreign_key_name) { 'writer_id' }
|
785
775
|
let(:constructor_options) do
|
786
|
-
super().merge(foreign_key_name:
|
776
|
+
super().merge(foreign_key_name:)
|
787
777
|
end
|
788
778
|
|
789
779
|
it { expect(subject.inverse_key_name).to be == 'writer_id' }
|
@@ -792,7 +782,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
792
782
|
context 'when initialized with foreign_key_name: a String' do
|
793
783
|
let(:foreign_key_name) { :writer_id }
|
794
784
|
let(:constructor_options) do
|
795
|
-
super().merge(foreign_key_name:
|
785
|
+
super().merge(foreign_key_name:)
|
796
786
|
end
|
797
787
|
|
798
788
|
it { expect(subject.inverse_key_name).to be == 'writer_id' }
|
@@ -801,7 +791,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
801
791
|
context 'when initialized with singular_name: value' do
|
802
792
|
let(:singular_name) { 'author' }
|
803
793
|
let(:constructor_options) do
|
804
|
-
super().merge(singular_name:
|
794
|
+
super().merge(singular_name:)
|
805
795
|
end
|
806
796
|
|
807
797
|
it { expect(subject.inverse_key_name).to be == 'author_id' }
|
@@ -809,7 +799,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
809
799
|
context 'when initialized with foreign_key_name: a String' do
|
810
800
|
let(:foreign_key_name) { 'writer_id' }
|
811
801
|
let(:constructor_options) do
|
812
|
-
super().merge(foreign_key_name:
|
802
|
+
super().merge(foreign_key_name:)
|
813
803
|
end
|
814
804
|
|
815
805
|
it { expect(subject.inverse_key_name).to be == 'writer_id' }
|
@@ -818,7 +808,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
818
808
|
context 'when initialized with foreign_key_name: a String' do
|
819
809
|
let(:foreign_key_name) { :writer_id }
|
820
810
|
let(:constructor_options) do
|
821
|
-
super().merge(foreign_key_name:
|
811
|
+
super().merge(foreign_key_name:)
|
822
812
|
end
|
823
813
|
|
824
814
|
it { expect(subject.inverse_key_name).to be == 'writer_id' }
|
@@ -1134,7 +1124,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1134
1124
|
context 'when initialized with primary_key_name: a String' do
|
1135
1125
|
let(:primary_key_name) { 'uuid' }
|
1136
1126
|
let(:constructor_options) do
|
1137
|
-
super().merge(primary_key_name:
|
1127
|
+
super().merge(primary_key_name:)
|
1138
1128
|
end
|
1139
1129
|
|
1140
1130
|
it { expect(subject.query_key_name).to be == primary_key_name }
|
@@ -1143,7 +1133,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1143
1133
|
context 'when initialized with primary_key_name: a Symbol' do
|
1144
1134
|
let(:primary_key_name) { :uuid }
|
1145
1135
|
let(:constructor_options) do
|
1146
|
-
super().merge(primary_key_name:
|
1136
|
+
super().merge(primary_key_name:)
|
1147
1137
|
end
|
1148
1138
|
|
1149
1139
|
it 'should set the primary key name' do
|
@@ -1176,7 +1166,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1176
1166
|
association.build_entities_query(*entities, **options)
|
1177
1167
|
end
|
1178
1168
|
let(:evaluated) do
|
1179
|
-
Spec::QueryBuilder.new
|
1169
|
+
query.call(Spec::QueryBuilder.new)
|
1180
1170
|
end
|
1181
1171
|
|
1182
1172
|
example_class 'Spec::Entity' do |klass|
|
@@ -1207,7 +1197,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1207
1197
|
context 'when initialized with foreign_key_name: value' do
|
1208
1198
|
let(:foreign_key_name) { 'author_id' }
|
1209
1199
|
let(:constructor_options) do
|
1210
|
-
super().merge(foreign_key_name:
|
1200
|
+
super().merge(foreign_key_name:)
|
1211
1201
|
end
|
1212
1202
|
|
1213
1203
|
describe 'with no entities' do
|
@@ -1365,7 +1355,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1365
1355
|
association.build_keys_query(*keys, **options)
|
1366
1356
|
end
|
1367
1357
|
let(:evaluated) do
|
1368
|
-
Spec::QueryBuilder.new
|
1358
|
+
query.call(Spec::QueryBuilder.new)
|
1369
1359
|
end
|
1370
1360
|
|
1371
1361
|
example_class 'Spec::QueryBuilder' do |klass|
|
@@ -1386,7 +1376,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1386
1376
|
context 'when initialized with foreign_key_name: value' do
|
1387
1377
|
let(:foreign_key_name) { 'author_id' }
|
1388
1378
|
let(:constructor_options) do
|
1389
|
-
super().merge(foreign_key_name:
|
1379
|
+
super().merge(foreign_key_name:)
|
1390
1380
|
end
|
1391
1381
|
|
1392
1382
|
describe 'with no keys' do
|
@@ -1462,7 +1452,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1462
1452
|
context 'when initialized with foreign_key_name: a String' do
|
1463
1453
|
let(:foreign_key_name) { 'writer_id' }
|
1464
1454
|
let(:constructor_options) do
|
1465
|
-
super().merge(foreign_key_name:
|
1455
|
+
super().merge(foreign_key_name:)
|
1466
1456
|
end
|
1467
1457
|
|
1468
1458
|
it { expect(subject.foreign_key_name).to be == 'writer_id' }
|
@@ -1471,7 +1461,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1471
1461
|
context 'when initialized with foreign_key_name: a String' do
|
1472
1462
|
let(:foreign_key_name) { :writer_id }
|
1473
1463
|
let(:constructor_options) do
|
1474
|
-
super().merge(foreign_key_name:
|
1464
|
+
super().merge(foreign_key_name:)
|
1475
1465
|
end
|
1476
1466
|
|
1477
1467
|
it { expect(subject.foreign_key_name).to be == 'writer_id' }
|
@@ -1480,7 +1470,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1480
1470
|
context 'when initialized with inverse: value' do
|
1481
1471
|
let(:inverse) { described_class.new(name: 'authors') }
|
1482
1472
|
let(:constructor_options) do
|
1483
|
-
super().merge(inverse:
|
1473
|
+
super().merge(inverse:)
|
1484
1474
|
end
|
1485
1475
|
|
1486
1476
|
it { expect(subject.foreign_key_name).to be == 'author_id' }
|
@@ -1488,7 +1478,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1488
1478
|
context 'when initialized with foreign_key_name: a String' do
|
1489
1479
|
let(:foreign_key_name) { 'writer_id' }
|
1490
1480
|
let(:constructor_options) do
|
1491
|
-
super().merge(foreign_key_name:
|
1481
|
+
super().merge(foreign_key_name:)
|
1492
1482
|
end
|
1493
1483
|
|
1494
1484
|
it { expect(subject.foreign_key_name).to be == 'writer_id' }
|
@@ -1497,7 +1487,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1497
1487
|
context 'when initialized with foreign_key_name: a String' do
|
1498
1488
|
let(:foreign_key_name) { :writer_id }
|
1499
1489
|
let(:constructor_options) do
|
1500
|
-
super().merge(foreign_key_name:
|
1490
|
+
super().merge(foreign_key_name:)
|
1501
1491
|
end
|
1502
1492
|
|
1503
1493
|
it { expect(subject.foreign_key_name).to be == 'writer_id' }
|
@@ -1506,7 +1496,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1506
1496
|
context 'when initialized with inverse_name: value' do
|
1507
1497
|
let(:inverse_name) { 'writers' }
|
1508
1498
|
let(:constructor_options) do
|
1509
|
-
super().merge(inverse_name:
|
1499
|
+
super().merge(inverse_name:)
|
1510
1500
|
end
|
1511
1501
|
|
1512
1502
|
it { expect(subject.foreign_key_name).to be == 'author_id' }
|
@@ -1515,7 +1505,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1515
1505
|
context 'when initialized with singular_inverse_name: value' do
|
1516
1506
|
let(:singular_inverse_name) { 'writer' }
|
1517
1507
|
let(:constructor_options) do
|
1518
|
-
super().merge(singular_inverse_name:
|
1508
|
+
super().merge(singular_inverse_name:)
|
1519
1509
|
end
|
1520
1510
|
|
1521
1511
|
it { expect(subject.foreign_key_name).to be == 'writer_id' }
|
@@ -1525,7 +1515,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1525
1515
|
context 'when initialized with inverse_name: value' do
|
1526
1516
|
let(:inverse_name) { 'authors' }
|
1527
1517
|
let(:constructor_options) do
|
1528
|
-
super().merge(inverse_name:
|
1518
|
+
super().merge(inverse_name:)
|
1529
1519
|
end
|
1530
1520
|
|
1531
1521
|
it { expect(subject.foreign_key_name).to be == 'author_id' }
|
@@ -1533,7 +1523,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1533
1523
|
context 'when initialized with foreign_key_name: a String' do
|
1534
1524
|
let(:foreign_key_name) { 'writer_id' }
|
1535
1525
|
let(:constructor_options) do
|
1536
|
-
super().merge(foreign_key_name:
|
1526
|
+
super().merge(foreign_key_name:)
|
1537
1527
|
end
|
1538
1528
|
|
1539
1529
|
it { expect(subject.foreign_key_name).to be == 'writer_id' }
|
@@ -1542,7 +1532,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1542
1532
|
context 'when initialized with foreign_key_name: a String' do
|
1543
1533
|
let(:foreign_key_name) { :writer_id }
|
1544
1534
|
let(:constructor_options) do
|
1545
|
-
super().merge(foreign_key_name:
|
1535
|
+
super().merge(foreign_key_name:)
|
1546
1536
|
end
|
1547
1537
|
|
1548
1538
|
it { expect(subject.foreign_key_name).to be == 'writer_id' }
|
@@ -1552,7 +1542,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1552
1542
|
context 'when initialized with singular_inverse_name: value' do
|
1553
1543
|
let(:singular_inverse_name) { 'author' }
|
1554
1544
|
let(:constructor_options) do
|
1555
|
-
super().merge(singular_inverse_name:
|
1545
|
+
super().merge(singular_inverse_name:)
|
1556
1546
|
end
|
1557
1547
|
|
1558
1548
|
it { expect(subject.foreign_key_name).to be == 'author_id' }
|
@@ -1560,7 +1550,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1560
1550
|
context 'when initialized with foreign_key_name: a String' do
|
1561
1551
|
let(:foreign_key_name) { 'writer_id' }
|
1562
1552
|
let(:constructor_options) do
|
1563
|
-
super().merge(foreign_key_name:
|
1553
|
+
super().merge(foreign_key_name:)
|
1564
1554
|
end
|
1565
1555
|
|
1566
1556
|
it { expect(subject.foreign_key_name).to be == 'writer_id' }
|
@@ -1569,7 +1559,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1569
1559
|
context 'when initialized with foreign_key_name: a String' do
|
1570
1560
|
let(:foreign_key_name) { :writer_id }
|
1571
1561
|
let(:constructor_options) do
|
1572
|
-
super().merge(foreign_key_name:
|
1562
|
+
super().merge(foreign_key_name:)
|
1573
1563
|
end
|
1574
1564
|
|
1575
1565
|
it { expect(subject.foreign_key_name).to be == 'writer_id' }
|
@@ -1588,7 +1578,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1588
1578
|
context 'when initialized with foreign_key_name: a String' do
|
1589
1579
|
let(:foreign_key_name) { 'writer_id' }
|
1590
1580
|
let(:constructor_options) do
|
1591
|
-
super().merge(foreign_key_name:
|
1581
|
+
super().merge(foreign_key_name:)
|
1592
1582
|
end
|
1593
1583
|
|
1594
1584
|
it { expect(subject.foreign_key_name).to be == 'writer_id' }
|
@@ -1597,7 +1587,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1597
1587
|
context 'when initialized with foreign_key_name: a String' do
|
1598
1588
|
let(:foreign_key_name) { :writer_id }
|
1599
1589
|
let(:constructor_options) do
|
1600
|
-
super().merge(foreign_key_name:
|
1590
|
+
super().merge(foreign_key_name:)
|
1601
1591
|
end
|
1602
1592
|
|
1603
1593
|
it { expect(subject.foreign_key_name).to be == 'writer_id' }
|
@@ -1606,7 +1596,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1606
1596
|
context 'when initialized with inverse: value' do
|
1607
1597
|
let(:inverse) { described_class.new(name: 'authors') }
|
1608
1598
|
let(:constructor_options) do
|
1609
|
-
super().merge(inverse:
|
1599
|
+
super().merge(inverse:)
|
1610
1600
|
end
|
1611
1601
|
|
1612
1602
|
it { expect(subject.foreign_key_name).to be == 'chapter_id' }
|
@@ -1615,7 +1605,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1615
1605
|
context 'when initialized with inverse_name: value' do
|
1616
1606
|
let(:inverse_name) { 'authors' }
|
1617
1607
|
let(:constructor_options) do
|
1618
|
-
super().merge(inverse_name:
|
1608
|
+
super().merge(inverse_name:)
|
1619
1609
|
end
|
1620
1610
|
|
1621
1611
|
it { expect(subject.foreign_key_name).to be == 'chapter_id' }
|
@@ -1624,7 +1614,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1624
1614
|
context 'when initialized with singular_inverse_name: value' do
|
1625
1615
|
let(:singular_inverse_name) { 'author' }
|
1626
1616
|
let(:constructor_options) do
|
1627
|
-
super().merge(singular_inverse_name:
|
1617
|
+
super().merge(singular_inverse_name:)
|
1628
1618
|
end
|
1629
1619
|
|
1630
1620
|
it { expect(subject.foreign_key_name).to be == 'author_id' }
|
@@ -1638,7 +1628,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1638
1628
|
context 'when initialized with primary_key_name: a String' do
|
1639
1629
|
let(:primary_key_name) { 'uuid' }
|
1640
1630
|
let(:constructor_options) do
|
1641
|
-
super().merge(primary_key_name:
|
1631
|
+
super().merge(primary_key_name:)
|
1642
1632
|
end
|
1643
1633
|
|
1644
1634
|
it { expect(subject.inverse_key_name).to be == primary_key_name }
|
@@ -1647,7 +1637,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1647
1637
|
context 'when initialized with primary_key_name: a Symbol' do
|
1648
1638
|
let(:primary_key_name) { :uuid }
|
1649
1639
|
let(:constructor_options) do
|
1650
|
-
super().merge(primary_key_name:
|
1640
|
+
super().merge(primary_key_name:)
|
1651
1641
|
end
|
1652
1642
|
|
1653
1643
|
it 'should set the primary key name' do
|
@@ -1962,7 +1952,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1962
1952
|
context 'when initialized with foreign_key_name: a String' do
|
1963
1953
|
let(:foreign_key_name) { 'writer_id' }
|
1964
1954
|
let(:constructor_options) do
|
1965
|
-
super().merge(foreign_key_name:
|
1955
|
+
super().merge(foreign_key_name:)
|
1966
1956
|
end
|
1967
1957
|
|
1968
1958
|
it { expect(subject.query_key_name).to be == 'writer_id' }
|
@@ -1971,7 +1961,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1971
1961
|
context 'when initialized with foreign_key_name: a String' do
|
1972
1962
|
let(:foreign_key_name) { :writer_id }
|
1973
1963
|
let(:constructor_options) do
|
1974
|
-
super().merge(foreign_key_name:
|
1964
|
+
super().merge(foreign_key_name:)
|
1975
1965
|
end
|
1976
1966
|
|
1977
1967
|
it { expect(subject.query_key_name).to be == 'writer_id' }
|
@@ -1980,7 +1970,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1980
1970
|
context 'when initialized with inverse: value' do
|
1981
1971
|
let(:inverse) { described_class.new(name: 'authors') }
|
1982
1972
|
let(:constructor_options) do
|
1983
|
-
super().merge(inverse:
|
1973
|
+
super().merge(inverse:)
|
1984
1974
|
end
|
1985
1975
|
|
1986
1976
|
it { expect(subject.query_key_name).to be == 'author_id' }
|
@@ -1988,7 +1978,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1988
1978
|
context 'when initialized with foreign_key_name: a String' do
|
1989
1979
|
let(:foreign_key_name) { 'writer_id' }
|
1990
1980
|
let(:constructor_options) do
|
1991
|
-
super().merge(foreign_key_name:
|
1981
|
+
super().merge(foreign_key_name:)
|
1992
1982
|
end
|
1993
1983
|
|
1994
1984
|
it { expect(subject.query_key_name).to be == 'writer_id' }
|
@@ -1997,7 +1987,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1997
1987
|
context 'when initialized with foreign_key_name: a String' do
|
1998
1988
|
let(:foreign_key_name) { :writer_id }
|
1999
1989
|
let(:constructor_options) do
|
2000
|
-
super().merge(foreign_key_name:
|
1990
|
+
super().merge(foreign_key_name:)
|
2001
1991
|
end
|
2002
1992
|
|
2003
1993
|
it { expect(subject.query_key_name).to be == 'writer_id' }
|
@@ -2006,7 +1996,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
2006
1996
|
context 'when initialized with inverse_name: value' do
|
2007
1997
|
let(:inverse_name) { 'writers' }
|
2008
1998
|
let(:constructor_options) do
|
2009
|
-
super().merge(inverse_name:
|
1999
|
+
super().merge(inverse_name:)
|
2010
2000
|
end
|
2011
2001
|
|
2012
2002
|
it { expect(subject.query_key_name).to be == 'author_id' }
|
@@ -2015,7 +2005,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
2015
2005
|
context 'when initialized with singular_inverse_name: value' do
|
2016
2006
|
let(:singular_inverse_name) { 'writer' }
|
2017
2007
|
let(:constructor_options) do
|
2018
|
-
super().merge(singular_inverse_name:
|
2008
|
+
super().merge(singular_inverse_name:)
|
2019
2009
|
end
|
2020
2010
|
|
2021
2011
|
it { expect(subject.query_key_name).to be == 'writer_id' }
|
@@ -2025,7 +2015,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
2025
2015
|
context 'when initialized with inverse_name: value' do
|
2026
2016
|
let(:inverse_name) { 'authors' }
|
2027
2017
|
let(:constructor_options) do
|
2028
|
-
super().merge(inverse_name:
|
2018
|
+
super().merge(inverse_name:)
|
2029
2019
|
end
|
2030
2020
|
|
2031
2021
|
it { expect(subject.query_key_name).to be == 'author_id' }
|
@@ -2033,7 +2023,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
2033
2023
|
context 'when initialized with foreign_key_name: a String' do
|
2034
2024
|
let(:foreign_key_name) { 'writer_id' }
|
2035
2025
|
let(:constructor_options) do
|
2036
|
-
super().merge(foreign_key_name:
|
2026
|
+
super().merge(foreign_key_name:)
|
2037
2027
|
end
|
2038
2028
|
|
2039
2029
|
it { expect(subject.query_key_name).to be == 'writer_id' }
|
@@ -2042,7 +2032,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
2042
2032
|
context 'when initialized with foreign_key_name: a String' do
|
2043
2033
|
let(:foreign_key_name) { :writer_id }
|
2044
2034
|
let(:constructor_options) do
|
2045
|
-
super().merge(foreign_key_name:
|
2035
|
+
super().merge(foreign_key_name:)
|
2046
2036
|
end
|
2047
2037
|
|
2048
2038
|
it { expect(subject.query_key_name).to be == 'writer_id' }
|
@@ -2052,7 +2042,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
2052
2042
|
context 'when initialized with singular_inverse_name: value' do
|
2053
2043
|
let(:singular_inverse_name) { 'author' }
|
2054
2044
|
let(:constructor_options) do
|
2055
|
-
super().merge(singular_inverse_name:
|
2045
|
+
super().merge(singular_inverse_name:)
|
2056
2046
|
end
|
2057
2047
|
|
2058
2048
|
it { expect(subject.query_key_name).to be == 'author_id' }
|
@@ -2060,7 +2050,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
2060
2050
|
context 'when initialized with foreign_key_name: a String' do
|
2061
2051
|
let(:foreign_key_name) { 'writer_id' }
|
2062
2052
|
let(:constructor_options) do
|
2063
|
-
super().merge(foreign_key_name:
|
2053
|
+
super().merge(foreign_key_name:)
|
2064
2054
|
end
|
2065
2055
|
|
2066
2056
|
it { expect(subject.query_key_name).to be == 'writer_id' }
|
@@ -2069,7 +2059,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
2069
2059
|
context 'when initialized with foreign_key_name: a String' do
|
2070
2060
|
let(:foreign_key_name) { :writer_id }
|
2071
2061
|
let(:constructor_options) do
|
2072
|
-
super().merge(foreign_key_name:
|
2062
|
+
super().merge(foreign_key_name:)
|
2073
2063
|
end
|
2074
2064
|
|
2075
2065
|
it { expect(subject.query_key_name).to be == 'writer_id' }
|
@@ -2088,7 +2078,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
2088
2078
|
context 'when initialized with foreign_key_name: a String' do
|
2089
2079
|
let(:foreign_key_name) { 'writer_id' }
|
2090
2080
|
let(:constructor_options) do
|
2091
|
-
super().merge(foreign_key_name:
|
2081
|
+
super().merge(foreign_key_name:)
|
2092
2082
|
end
|
2093
2083
|
|
2094
2084
|
it { expect(subject.query_key_name).to be == 'writer_id' }
|
@@ -2097,7 +2087,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
2097
2087
|
context 'when initialized with foreign_key_name: a String' do
|
2098
2088
|
let(:foreign_key_name) { :writer_id }
|
2099
2089
|
let(:constructor_options) do
|
2100
|
-
super().merge(foreign_key_name:
|
2090
|
+
super().merge(foreign_key_name:)
|
2101
2091
|
end
|
2102
2092
|
|
2103
2093
|
it { expect(subject.query_key_name).to be == 'writer_id' }
|
@@ -2106,7 +2096,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
2106
2096
|
context 'when initialized with inverse: value' do
|
2107
2097
|
let(:inverse) { described_class.new(name: 'authors') }
|
2108
2098
|
let(:constructor_options) do
|
2109
|
-
super().merge(inverse:
|
2099
|
+
super().merge(inverse:)
|
2110
2100
|
end
|
2111
2101
|
|
2112
2102
|
it { expect(subject.query_key_name).to be == 'chapter_id' }
|
@@ -2115,7 +2105,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
2115
2105
|
context 'when initialized with inverse_name: value' do
|
2116
2106
|
let(:inverse_name) { 'authors' }
|
2117
2107
|
let(:constructor_options) do
|
2118
|
-
super().merge(inverse_name:
|
2108
|
+
super().merge(inverse_name:)
|
2119
2109
|
end
|
2120
2110
|
|
2121
2111
|
it { expect(subject.query_key_name).to be == 'chapter_id' }
|
@@ -2124,7 +2114,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
2124
2114
|
context 'when initialized with singular_inverse_name: value' do
|
2125
2115
|
let(:singular_inverse_name) { 'author' }
|
2126
2116
|
let(:constructor_options) do
|
2127
|
-
super().merge(singular_inverse_name:
|
2117
|
+
super().merge(singular_inverse_name:)
|
2128
2118
|
end
|
2129
2119
|
|
2130
2120
|
it { expect(subject.query_key_name).to be == 'author_id' }
|