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
@@ -4,127 +4,10 @@ require 'cuprum/collections/rspec/contracts'
|
|
4
4
|
|
5
5
|
module Cuprum::Collections::RSpec::Contracts
|
6
6
|
# Contracts for asserting on Relation objects.
|
7
|
+
#
|
8
|
+
# @deprecated 0.5.0 Relation contracts are deprecated. Use
|
9
|
+
# Deferred::RelationExamples instead.
|
7
10
|
module RelationContracts
|
8
|
-
# Contract asserting that the Relation resolves the given parameter.
|
9
|
-
module ShouldDisambiguateParameter
|
10
|
-
extend RSpec::SleepingKingStudios::Contract
|
11
|
-
|
12
|
-
# @!method apply(example_group, key, as:, value:)
|
13
|
-
# Adds the contract to the example group.
|
14
|
-
#
|
15
|
-
# @param example_group [RSpec::Core::ExampleGroup] the example group to
|
16
|
-
# which the contract is applied.
|
17
|
-
# @param key [Symbol] the original parameter key.
|
18
|
-
# @param as [Symbol, Array<Symbol>] the aliased key or keys.
|
19
|
-
# @param value [Object] the custom value for the property.
|
20
|
-
contract do |key, as:, value: 'custom value'|
|
21
|
-
describe '.new' do
|
22
|
-
Array(as).each do |alt|
|
23
|
-
describe "with #{key}: value and #{alt}: value" do
|
24
|
-
let(:error_message) do
|
25
|
-
"ambiguous parameter #{key}: initialized with parameters " \
|
26
|
-
"#{key}: #{value.inspect}, #{alt}: #{value.inspect}"
|
27
|
-
end
|
28
|
-
|
29
|
-
it 'should raise an exception' do
|
30
|
-
expect do
|
31
|
-
described_class.new(
|
32
|
-
name: 'books',
|
33
|
-
key => value,
|
34
|
-
alt => value
|
35
|
-
)
|
36
|
-
end
|
37
|
-
.to raise_error ArgumentError, error_message
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
Array(as).each do |alt|
|
44
|
-
describe "##{alt}" do
|
45
|
-
let(:core_tools) do
|
46
|
-
SleepingKingStudios::Tools::Toolbelt.instance.core_tools
|
47
|
-
end
|
48
|
-
|
49
|
-
before(:example) { allow(core_tools).to receive(:deprecate) }
|
50
|
-
|
51
|
-
include_examples 'should define reader',
|
52
|
-
alt,
|
53
|
-
-> { subject.send(key) }
|
54
|
-
|
55
|
-
it 'should print a deprecation warning' do
|
56
|
-
subject.send(alt)
|
57
|
-
|
58
|
-
expect(core_tools)
|
59
|
-
.to have_received(:deprecate)
|
60
|
-
.with(
|
61
|
-
"##{alt} method",
|
62
|
-
message: "Use ##{key} instead"
|
63
|
-
)
|
64
|
-
end
|
65
|
-
|
66
|
-
context "when initialized with #{key}: value" do
|
67
|
-
let(:constructor_options) do
|
68
|
-
super().merge(key => value)
|
69
|
-
end
|
70
|
-
|
71
|
-
it { expect(subject.send(alt)).to be == value }
|
72
|
-
end
|
73
|
-
|
74
|
-
Array(as).each do |given|
|
75
|
-
context "when initialized with #{given}: value" do
|
76
|
-
let(:constructor_options) do
|
77
|
-
super()
|
78
|
-
.tap { |hsh| hsh.delete(key) }
|
79
|
-
.merge(given => value)
|
80
|
-
end
|
81
|
-
|
82
|
-
it { expect(subject.send(alt)).to be == value }
|
83
|
-
end
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
describe "##{key}" do
|
89
|
-
Array(as).each do |alt|
|
90
|
-
context "when initialized with #{alt}: value" do
|
91
|
-
let(:constructor_options) do
|
92
|
-
super()
|
93
|
-
.tap { |hsh| hsh.delete(key) }
|
94
|
-
.merge(alt => value)
|
95
|
-
end
|
96
|
-
let(:core_tools) do
|
97
|
-
SleepingKingStudios::Tools::Toolbelt.instance.core_tools
|
98
|
-
end
|
99
|
-
|
100
|
-
before(:example) { allow(core_tools).to receive(:deprecate) }
|
101
|
-
|
102
|
-
it { expect(subject.send(key)).to be == value }
|
103
|
-
end
|
104
|
-
end
|
105
|
-
end
|
106
|
-
|
107
|
-
describe '#options' do
|
108
|
-
Array(as).each do |alt|
|
109
|
-
context "when initialized with #{alt}: value" do
|
110
|
-
let(:constructor_options) do
|
111
|
-
super()
|
112
|
-
.tap { |hsh| hsh.delete(key) }
|
113
|
-
.merge(alt => value)
|
114
|
-
end
|
115
|
-
let(:core_tools) do
|
116
|
-
SleepingKingStudios::Tools::Toolbelt.instance.core_tools
|
117
|
-
end
|
118
|
-
|
119
|
-
before(:example) { allow(core_tools).to receive(:deprecate) }
|
120
|
-
|
121
|
-
it { expect(subject.options).not_to have_key alt }
|
122
|
-
end
|
123
|
-
end
|
124
|
-
end
|
125
|
-
end
|
126
|
-
end
|
127
|
-
|
128
11
|
# Contract asserting that the method validates the required parameters.
|
129
12
|
module ShouldValidateTheParametersContract
|
130
13
|
extend RSpec::SleepingKingStudios::Contract
|
@@ -471,7 +354,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
471
354
|
let(:constructor_options) do
|
472
355
|
super()
|
473
356
|
.tap { |hsh| hsh.delete(:name) }
|
474
|
-
.merge(entity_class:
|
357
|
+
.merge(entity_class:)
|
475
358
|
end
|
476
359
|
|
477
360
|
it { expect(subject.entity_class).to be Grimoire }
|
@@ -482,7 +365,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
482
365
|
let(:constructor_options) do
|
483
366
|
super()
|
484
367
|
.tap { |hsh| hsh.delete(:name) }
|
485
|
-
.merge(entity_class:
|
368
|
+
.merge(entity_class:)
|
486
369
|
end
|
487
370
|
|
488
371
|
it { expect(subject.entity_class).to be Spec::ScopedBook }
|
@@ -493,7 +376,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
493
376
|
let(:constructor_options) do
|
494
377
|
super()
|
495
378
|
.tap { |hsh| hsh.delete(:name) }
|
496
|
-
.merge(entity_class:
|
379
|
+
.merge(entity_class:)
|
497
380
|
end
|
498
381
|
|
499
382
|
it { expect(subject.entity_class).to be Grimoire }
|
@@ -504,7 +387,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
504
387
|
let(:constructor_options) do
|
505
388
|
super()
|
506
389
|
.tap { |hsh| hsh.delete(:name) }
|
507
|
-
.merge(entity_class:
|
390
|
+
.merge(entity_class:)
|
508
391
|
end
|
509
392
|
|
510
393
|
it { expect(subject.entity_class).to be Spec::ScopedBook }
|
@@ -513,7 +396,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
513
396
|
context 'when initialized with name: a String' do
|
514
397
|
let(:name) { 'books' }
|
515
398
|
let(:constructor_options) do
|
516
|
-
super().merge(name:
|
399
|
+
super().merge(name:)
|
517
400
|
end
|
518
401
|
let(:expected) { options[:default_entity_class] || Book }
|
519
402
|
|
@@ -524,7 +407,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
524
407
|
let(:constructor_options) do
|
525
408
|
super()
|
526
409
|
.tap { |hsh| hsh.delete(:name) }
|
527
|
-
.merge(entity_class:
|
410
|
+
.merge(entity_class:)
|
528
411
|
end
|
529
412
|
|
530
413
|
it { expect(subject.entity_class).to be Grimoire }
|
@@ -533,7 +416,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
533
416
|
context 'when initialized with qualified_name: value' do
|
534
417
|
let(:qualified_name) { 'spec/scoped_books' }
|
535
418
|
let(:constructor_options) do
|
536
|
-
super().merge(qualified_name:
|
419
|
+
super().merge(qualified_name:)
|
537
420
|
end
|
538
421
|
let(:expected) do
|
539
422
|
options[:default_entity_class] || Spec::ScopedBook
|
@@ -546,7 +429,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
546
429
|
let(:constructor_options) do
|
547
430
|
super()
|
548
431
|
.tap { |hsh| hsh.delete(:name) }
|
549
|
-
.merge(entity_class:
|
432
|
+
.merge(entity_class:)
|
550
433
|
end
|
551
434
|
|
552
435
|
it { expect(subject.entity_class).to be Grimoire }
|
@@ -557,7 +440,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
557
440
|
context 'when initialized with name: a Symbol' do
|
558
441
|
let(:name) { 'books' }
|
559
442
|
let(:constructor_options) do
|
560
|
-
super().merge(name:
|
443
|
+
super().merge(name:)
|
561
444
|
end
|
562
445
|
let(:expected) { options[:default_entity_class] || Book }
|
563
446
|
|
@@ -568,7 +451,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
568
451
|
let(:constructor_options) do
|
569
452
|
super()
|
570
453
|
.tap { |hsh| hsh.delete(:name) }
|
571
|
-
.merge(entity_class:
|
454
|
+
.merge(entity_class:)
|
572
455
|
end
|
573
456
|
|
574
457
|
it { expect(subject.entity_class).to be Grimoire }
|
@@ -577,7 +460,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
577
460
|
context 'when initialized with qualified_name: value' do
|
578
461
|
let(:qualified_name) { 'spec/scoped_books' }
|
579
462
|
let(:constructor_options) do
|
580
|
-
super().merge(qualified_name:
|
463
|
+
super().merge(qualified_name:)
|
581
464
|
end
|
582
465
|
let(:expected) do
|
583
466
|
options[:default_entity_class] || Spec::ScopedBook
|
@@ -590,7 +473,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
590
473
|
let(:constructor_options) do
|
591
474
|
super()
|
592
475
|
.tap { |hsh| hsh.delete(:name) }
|
593
|
-
.merge(entity_class:
|
476
|
+
.merge(entity_class:)
|
594
477
|
end
|
595
478
|
|
596
479
|
it { expect(subject.entity_class).to be Grimoire }
|
@@ -601,7 +484,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
601
484
|
context 'when initialized with qualified_name: a String' do
|
602
485
|
let(:qualified_name) { 'spec/scoped_books' }
|
603
486
|
let(:constructor_options) do
|
604
|
-
super().merge(qualified_name:
|
487
|
+
super().merge(qualified_name:)
|
605
488
|
end
|
606
489
|
let(:expected) do
|
607
490
|
options[:default_entity_class] || Spec::ScopedBook
|
@@ -614,7 +497,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
614
497
|
let(:constructor_options) do
|
615
498
|
super()
|
616
499
|
.tap { |hsh| hsh.delete(:name) }
|
617
|
-
.merge(entity_class:
|
500
|
+
.merge(entity_class:)
|
618
501
|
end
|
619
502
|
|
620
503
|
it { expect(subject.entity_class).to be Grimoire }
|
@@ -624,7 +507,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
624
507
|
context 'when initialized with qualified_name: a Symbol' do
|
625
508
|
let(:qualified_name) { :'spec/scoped_books' }
|
626
509
|
let(:constructor_options) do
|
627
|
-
super().merge(qualified_name:
|
510
|
+
super().merge(qualified_name:)
|
628
511
|
end
|
629
512
|
let(:expected) do
|
630
513
|
options[:default_entity_class] || Spec::ScopedBook
|
@@ -637,7 +520,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
637
520
|
let(:constructor_options) do
|
638
521
|
super()
|
639
522
|
.tap { |hsh| hsh.delete(:name) }
|
640
|
-
.merge(entity_class:
|
523
|
+
.merge(entity_class:)
|
641
524
|
end
|
642
525
|
|
643
526
|
it { expect(subject.entity_class).to be Grimoire }
|
@@ -653,7 +536,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
653
536
|
let(:constructor_options) do
|
654
537
|
super()
|
655
538
|
.tap { |hsh| hsh.delete(:name) }
|
656
|
-
.merge(entity_class:
|
539
|
+
.merge(entity_class:)
|
657
540
|
end
|
658
541
|
|
659
542
|
it { expect(subject.plural_name).to be == 'grimoires' }
|
@@ -661,7 +544,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
661
544
|
context 'when initialized with plural_name: value' do
|
662
545
|
let(:plural_name) { 'books' }
|
663
546
|
let(:constructor_options) do
|
664
|
-
super().merge(plural_name:
|
547
|
+
super().merge(plural_name:)
|
665
548
|
end
|
666
549
|
|
667
550
|
it { expect(subject.plural_name).to be == plural_name }
|
@@ -673,7 +556,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
673
556
|
let(:constructor_options) do
|
674
557
|
super()
|
675
558
|
.tap { |hsh| hsh.delete(:name) }
|
676
|
-
.merge(entity_class:
|
559
|
+
.merge(entity_class:)
|
677
560
|
end
|
678
561
|
|
679
562
|
it { expect(subject.plural_name).to be == 'scoped_books' }
|
@@ -681,7 +564,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
681
564
|
context 'when initialized with plural_name: value' do
|
682
565
|
let(:plural_name) { 'books' }
|
683
566
|
let(:constructor_options) do
|
684
|
-
super().merge(plural_name:
|
567
|
+
super().merge(plural_name:)
|
685
568
|
end
|
686
569
|
|
687
570
|
it { expect(subject.plural_name).to be == plural_name }
|
@@ -693,7 +576,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
693
576
|
let(:constructor_options) do
|
694
577
|
super()
|
695
578
|
.tap { |hsh| hsh.delete(:name) }
|
696
|
-
.merge(entity_class:
|
579
|
+
.merge(entity_class:)
|
697
580
|
end
|
698
581
|
|
699
582
|
it { expect(subject.plural_name).to be == 'grimoires' }
|
@@ -701,7 +584,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
701
584
|
context 'when initialized with plural_name: value' do
|
702
585
|
let(:plural_name) { 'books' }
|
703
586
|
let(:constructor_options) do
|
704
|
-
super().merge(plural_name:
|
587
|
+
super().merge(plural_name:)
|
705
588
|
end
|
706
589
|
|
707
590
|
it { expect(subject.plural_name).to be == plural_name }
|
@@ -713,7 +596,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
713
596
|
let(:constructor_options) do
|
714
597
|
super()
|
715
598
|
.tap { |hsh| hsh.delete(:name) }
|
716
|
-
.merge(entity_class:
|
599
|
+
.merge(entity_class:)
|
717
600
|
end
|
718
601
|
|
719
602
|
it { expect(subject.plural_name).to be == 'scoped_books' }
|
@@ -721,7 +604,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
721
604
|
context 'when initialized with plural_name: value' do
|
722
605
|
let(:plural_name) { 'books' }
|
723
606
|
let(:constructor_options) do
|
724
|
-
super().merge(plural_name:
|
607
|
+
super().merge(plural_name:)
|
725
608
|
end
|
726
609
|
|
727
610
|
it { expect(subject.plural_name).to be == plural_name }
|
@@ -731,7 +614,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
731
614
|
context 'when initialized with name: a String' do
|
732
615
|
let(:name) { 'grimoires' }
|
733
616
|
let(:constructor_options) do
|
734
|
-
super().merge(name:
|
617
|
+
super().merge(name:)
|
735
618
|
end
|
736
619
|
|
737
620
|
it { expect(subject.plural_name).to be == 'grimoires' }
|
@@ -739,7 +622,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
739
622
|
context 'when initialized with plural_name: value' do
|
740
623
|
let(:plural_name) { 'books' }
|
741
624
|
let(:constructor_options) do
|
742
|
-
super().merge(plural_name:
|
625
|
+
super().merge(plural_name:)
|
743
626
|
end
|
744
627
|
|
745
628
|
it { expect(subject.plural_name).to be == plural_name }
|
@@ -749,7 +632,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
749
632
|
context 'when initialized with name: a Symbol' do
|
750
633
|
let(:name) { :grimoires }
|
751
634
|
let(:constructor_options) do
|
752
|
-
super().merge(name:
|
635
|
+
super().merge(name:)
|
753
636
|
end
|
754
637
|
|
755
638
|
it { expect(subject.plural_name).to be == 'grimoires' }
|
@@ -757,7 +640,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
757
640
|
context 'when initialized with plural_name: value' do
|
758
641
|
let(:plural_name) { 'books' }
|
759
642
|
let(:constructor_options) do
|
760
|
-
super().merge(plural_name:
|
643
|
+
super().merge(plural_name:)
|
761
644
|
end
|
762
645
|
|
763
646
|
it { expect(subject.plural_name).to be == plural_name }
|
@@ -773,7 +656,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
773
656
|
let(:constructor_options) do
|
774
657
|
super()
|
775
658
|
.tap { |hsh| hsh.delete(:name) }
|
776
|
-
.merge(entity_class:
|
659
|
+
.merge(entity_class:)
|
777
660
|
end
|
778
661
|
|
779
662
|
it { expect(subject.singular_name).to be == 'grimoire' }
|
@@ -781,7 +664,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
781
664
|
context 'when initialized with singular_name: value' do
|
782
665
|
let(:singular_name) { 'book' }
|
783
666
|
let(:constructor_options) do
|
784
|
-
super().merge(singular_name:
|
667
|
+
super().merge(singular_name:)
|
785
668
|
end
|
786
669
|
|
787
670
|
it { expect(subject.singular_name).to be == singular_name }
|
@@ -793,7 +676,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
793
676
|
let(:constructor_options) do
|
794
677
|
super()
|
795
678
|
.tap { |hsh| hsh.delete(:name) }
|
796
|
-
.merge(entity_class:
|
679
|
+
.merge(entity_class:)
|
797
680
|
end
|
798
681
|
|
799
682
|
it { expect(subject.singular_name).to be == 'scoped_book' }
|
@@ -801,7 +684,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
801
684
|
context 'when initialized with singular_name: value' do
|
802
685
|
let(:singular_name) { 'book' }
|
803
686
|
let(:constructor_options) do
|
804
|
-
super().merge(singular_name:
|
687
|
+
super().merge(singular_name:)
|
805
688
|
end
|
806
689
|
|
807
690
|
it { expect(subject.singular_name).to be == singular_name }
|
@@ -813,7 +696,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
813
696
|
let(:constructor_options) do
|
814
697
|
super()
|
815
698
|
.tap { |hsh| hsh.delete(:name) }
|
816
|
-
.merge(entity_class:
|
699
|
+
.merge(entity_class:)
|
817
700
|
end
|
818
701
|
|
819
702
|
it { expect(subject.singular_name).to be == 'grimoire' }
|
@@ -821,7 +704,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
821
704
|
context 'when initialized with singular_name: value' do
|
822
705
|
let(:singular_name) { 'book' }
|
823
706
|
let(:constructor_options) do
|
824
|
-
super().merge(singular_name:
|
707
|
+
super().merge(singular_name:)
|
825
708
|
end
|
826
709
|
|
827
710
|
it { expect(subject.singular_name).to be == singular_name }
|
@@ -833,7 +716,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
833
716
|
let(:constructor_options) do
|
834
717
|
super()
|
835
718
|
.tap { |hsh| hsh.delete(:name) }
|
836
|
-
.merge(entity_class:
|
719
|
+
.merge(entity_class:)
|
837
720
|
end
|
838
721
|
|
839
722
|
it { expect(subject.singular_name).to be == 'scoped_book' }
|
@@ -841,7 +724,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
841
724
|
context 'when initialized with singular_name: value' do
|
842
725
|
let(:singular_name) { 'book' }
|
843
726
|
let(:constructor_options) do
|
844
|
-
super().merge(singular_name:
|
727
|
+
super().merge(singular_name:)
|
845
728
|
end
|
846
729
|
|
847
730
|
it { expect(subject.singular_name).to be == singular_name }
|
@@ -851,7 +734,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
851
734
|
context 'when initialized with name: a String' do
|
852
735
|
let(:name) { 'grimoires' }
|
853
736
|
let(:constructor_options) do
|
854
|
-
super().merge(name:
|
737
|
+
super().merge(name:)
|
855
738
|
end
|
856
739
|
|
857
740
|
it { expect(subject.singular_name).to be == 'grimoire' }
|
@@ -859,7 +742,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
859
742
|
context 'when initialized with singular_name: value' do
|
860
743
|
let(:singular_name) { 'book' }
|
861
744
|
let(:constructor_options) do
|
862
|
-
super().merge(singular_name:
|
745
|
+
super().merge(singular_name:)
|
863
746
|
end
|
864
747
|
|
865
748
|
it { expect(subject.singular_name).to be == singular_name }
|
@@ -869,7 +752,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
869
752
|
context 'when initialized with name: a Symbol' do
|
870
753
|
let(:name) { :grimoires }
|
871
754
|
let(:constructor_options) do
|
872
|
-
super().merge(name:
|
755
|
+
super().merge(name:)
|
873
756
|
end
|
874
757
|
|
875
758
|
it { expect(subject.singular_name).to be == 'grimoire' }
|
@@ -877,7 +760,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
877
760
|
context 'when initialized with singular_name: value' do
|
878
761
|
let(:singular_name) { 'book' }
|
879
762
|
let(:constructor_options) do
|
880
|
-
super().merge(singular_name:
|
763
|
+
super().merge(singular_name:)
|
881
764
|
end
|
882
765
|
|
883
766
|
it { expect(subject.singular_name).to be == singular_name }
|
@@ -893,7 +776,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
893
776
|
let(:constructor_options) do
|
894
777
|
super()
|
895
778
|
.tap { |hsh| hsh.delete(:name) }
|
896
|
-
.merge(entity_class:
|
779
|
+
.merge(entity_class:)
|
897
780
|
end
|
898
781
|
|
899
782
|
it { expect(subject.name).to be == 'grimoires' }
|
@@ -901,7 +784,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
901
784
|
context 'when initialized with name: value' do
|
902
785
|
let(:name) { 'books' }
|
903
786
|
let(:constructor_options) do
|
904
|
-
super().merge(name:
|
787
|
+
super().merge(name:)
|
905
788
|
end
|
906
789
|
|
907
790
|
it { expect(subject.name).to be == name }
|
@@ -913,7 +796,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
913
796
|
let(:constructor_options) do
|
914
797
|
super()
|
915
798
|
.tap { |hsh| hsh.delete(:name) }
|
916
|
-
.merge(entity_class:
|
799
|
+
.merge(entity_class:)
|
917
800
|
end
|
918
801
|
|
919
802
|
it { expect(subject.name).to be == 'scoped_books' }
|
@@ -921,7 +804,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
921
804
|
context 'when initialized with name: value' do
|
922
805
|
let(:name) { 'books' }
|
923
806
|
let(:constructor_options) do
|
924
|
-
super().merge(name:
|
807
|
+
super().merge(name:)
|
925
808
|
end
|
926
809
|
|
927
810
|
it { expect(subject.name).to be == name }
|
@@ -933,7 +816,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
933
816
|
let(:constructor_options) do
|
934
817
|
super()
|
935
818
|
.tap { |hsh| hsh.delete(:name) }
|
936
|
-
.merge(entity_class:
|
819
|
+
.merge(entity_class:)
|
937
820
|
end
|
938
821
|
|
939
822
|
it { expect(subject.name).to be == 'grimoires' }
|
@@ -941,7 +824,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
941
824
|
context 'when initialized with name: value' do
|
942
825
|
let(:name) { 'books' }
|
943
826
|
let(:constructor_options) do
|
944
|
-
super().merge(name:
|
827
|
+
super().merge(name:)
|
945
828
|
end
|
946
829
|
|
947
830
|
it { expect(subject.name).to be == name }
|
@@ -953,7 +836,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
953
836
|
let(:constructor_options) do
|
954
837
|
super()
|
955
838
|
.tap { |hsh| hsh.delete(:name) }
|
956
|
-
.merge(entity_class:
|
839
|
+
.merge(entity_class:)
|
957
840
|
end
|
958
841
|
|
959
842
|
it { expect(subject.name).to be == 'scoped_books' }
|
@@ -961,7 +844,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
961
844
|
context 'when initialized with name: value' do
|
962
845
|
let(:name) { 'books' }
|
963
846
|
let(:constructor_options) do
|
964
|
-
super().merge(name:
|
847
|
+
super().merge(name:)
|
965
848
|
end
|
966
849
|
|
967
850
|
it { expect(subject.name).to be == name }
|
@@ -971,7 +854,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
971
854
|
context 'when initialized with name: a String' do
|
972
855
|
let(:name) { 'books' }
|
973
856
|
let(:constructor_options) do
|
974
|
-
super().merge(name:
|
857
|
+
super().merge(name:)
|
975
858
|
end
|
976
859
|
|
977
860
|
it { expect(subject.name).to be == name }
|
@@ -980,7 +863,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
980
863
|
context 'when initialized with name: a Symbol' do
|
981
864
|
let(:name) { :books }
|
982
865
|
let(:constructor_options) do
|
983
|
-
super().merge(name:
|
866
|
+
super().merge(name:)
|
984
867
|
end
|
985
868
|
|
986
869
|
it { expect(subject.name).to be == name.to_s }
|
@@ -995,7 +878,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
995
878
|
let(:constructor_options) do
|
996
879
|
super()
|
997
880
|
.tap { |hsh| hsh.delete(:name) }
|
998
|
-
.merge(entity_class:
|
881
|
+
.merge(entity_class:)
|
999
882
|
end
|
1000
883
|
|
1001
884
|
it { expect(subject.options).to be == {} }
|
@@ -1004,7 +887,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1004
887
|
context 'when initialized with singular_name: value' do
|
1005
888
|
let(:singular_name) { 'book' }
|
1006
889
|
let(:constructor_options) do
|
1007
|
-
super().merge(singular_name:
|
890
|
+
super().merge(singular_name:)
|
1008
891
|
end
|
1009
892
|
|
1010
893
|
it { expect(subject.options).to be == {} }
|
@@ -1013,7 +896,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1013
896
|
context 'when initialized with name: value' do
|
1014
897
|
let(:name) { 'books' }
|
1015
898
|
let(:constructor_options) do
|
1016
|
-
super().merge(name:
|
899
|
+
super().merge(name:)
|
1017
900
|
end
|
1018
901
|
|
1019
902
|
it { expect(subject.options).to be == {} }
|
@@ -1022,7 +905,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1022
905
|
context 'when initialized with qualified_name: value' do
|
1023
906
|
let(:qualified_name) { 'spec/scoped_books' }
|
1024
907
|
let(:constructor_options) do
|
1025
|
-
super().merge(qualified_name:
|
908
|
+
super().merge(qualified_name:)
|
1026
909
|
end
|
1027
910
|
|
1028
911
|
it { expect(subject.options).to be == {} }
|
@@ -1046,7 +929,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1046
929
|
let(:constructor_options) do
|
1047
930
|
super()
|
1048
931
|
.tap { |hsh| hsh.delete(:name) }
|
1049
|
-
.merge(entity_class:
|
932
|
+
.merge(entity_class:)
|
1050
933
|
end
|
1051
934
|
|
1052
935
|
it { expect(subject.qualified_name).to be == 'grimoires' }
|
@@ -1054,7 +937,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1054
937
|
context 'when initialized with qualified_name: value' do
|
1055
938
|
let(:qualified_name) { 'path/to/books' }
|
1056
939
|
let(:constructor_options) do
|
1057
|
-
super().merge(qualified_name:
|
940
|
+
super().merge(qualified_name:)
|
1058
941
|
end
|
1059
942
|
|
1060
943
|
it { expect(subject.qualified_name).to be == qualified_name }
|
@@ -1066,7 +949,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1066
949
|
let(:constructor_options) do
|
1067
950
|
super()
|
1068
951
|
.tap { |hsh| hsh.delete(:name) }
|
1069
|
-
.merge(entity_class:
|
952
|
+
.merge(entity_class:)
|
1070
953
|
end
|
1071
954
|
|
1072
955
|
it { expect(subject.qualified_name).to be == 'spec/scoped_books' }
|
@@ -1074,7 +957,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1074
957
|
context 'when initialized with qualified_name: value' do
|
1075
958
|
let(:qualified_name) { 'path/to/books' }
|
1076
959
|
let(:constructor_options) do
|
1077
|
-
super().merge(qualified_name:
|
960
|
+
super().merge(qualified_name:)
|
1078
961
|
end
|
1079
962
|
|
1080
963
|
it { expect(subject.qualified_name).to be == qualified_name }
|
@@ -1086,7 +969,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1086
969
|
let(:constructor_options) do
|
1087
970
|
super()
|
1088
971
|
.tap { |hsh| hsh.delete(:name) }
|
1089
|
-
.merge(entity_class:
|
972
|
+
.merge(entity_class:)
|
1090
973
|
end
|
1091
974
|
|
1092
975
|
it { expect(subject.qualified_name).to be == 'grimoires' }
|
@@ -1094,7 +977,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1094
977
|
context 'when initialized with qualified_name: value' do
|
1095
978
|
let(:qualified_name) { 'path/to/books' }
|
1096
979
|
let(:constructor_options) do
|
1097
|
-
super().merge(qualified_name:
|
980
|
+
super().merge(qualified_name:)
|
1098
981
|
end
|
1099
982
|
|
1100
983
|
it { expect(subject.qualified_name).to be == qualified_name }
|
@@ -1106,7 +989,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1106
989
|
let(:constructor_options) do
|
1107
990
|
super()
|
1108
991
|
.tap { |hsh| hsh.delete(:name) }
|
1109
|
-
.merge(entity_class:
|
992
|
+
.merge(entity_class:)
|
1110
993
|
end
|
1111
994
|
|
1112
995
|
it { expect(subject.qualified_name).to be == 'spec/scoped_books' }
|
@@ -1114,7 +997,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1114
997
|
context 'when initialized with qualified_name: value' do
|
1115
998
|
let(:qualified_name) { 'path/to/books' }
|
1116
999
|
let(:constructor_options) do
|
1117
|
-
super().merge(qualified_name:
|
1000
|
+
super().merge(qualified_name:)
|
1118
1001
|
end
|
1119
1002
|
|
1120
1003
|
it { expect(subject.qualified_name).to be == qualified_name }
|
@@ -1124,7 +1007,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1124
1007
|
context 'when initialized with name: a String' do
|
1125
1008
|
let(:name) { 'books' }
|
1126
1009
|
let(:constructor_options) do
|
1127
|
-
super().merge(name:
|
1010
|
+
super().merge(name:)
|
1128
1011
|
end
|
1129
1012
|
|
1130
1013
|
it { expect(subject.qualified_name).to be == name }
|
@@ -1132,7 +1015,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1132
1015
|
context 'when initialized with qualified_name: value' do
|
1133
1016
|
let(:qualified_name) { 'path/to/books' }
|
1134
1017
|
let(:constructor_options) do
|
1135
|
-
super().merge(qualified_name:
|
1018
|
+
super().merge(qualified_name:)
|
1136
1019
|
end
|
1137
1020
|
|
1138
1021
|
it { expect(subject.qualified_name).to be == qualified_name }
|
@@ -1142,7 +1025,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1142
1025
|
context 'when initialized with name: a Symbol' do
|
1143
1026
|
let(:name) { :books }
|
1144
1027
|
let(:constructor_options) do
|
1145
|
-
super().merge(name:
|
1028
|
+
super().merge(name:)
|
1146
1029
|
end
|
1147
1030
|
|
1148
1031
|
it { expect(subject.qualified_name).to be == name.to_s }
|
@@ -1150,7 +1033,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1150
1033
|
context 'when initialized with qualified_name: value' do
|
1151
1034
|
let(:qualified_name) { 'path/to/books' }
|
1152
1035
|
let(:constructor_options) do
|
1153
|
-
super().merge(qualified_name:
|
1036
|
+
super().merge(qualified_name:)
|
1154
1037
|
end
|
1155
1038
|
|
1156
1039
|
it { expect(subject.qualified_name).to be == qualified_name }
|
@@ -1160,7 +1043,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1160
1043
|
context 'when initialized with qualified_name: a String' do
|
1161
1044
|
let(:qualified_name) { 'path/to/books' }
|
1162
1045
|
let(:constructor_options) do
|
1163
|
-
super().merge(qualified_name:
|
1046
|
+
super().merge(qualified_name:)
|
1164
1047
|
end
|
1165
1048
|
|
1166
1049
|
it { expect(subject.qualified_name).to be == qualified_name }
|
@@ -1169,7 +1052,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1169
1052
|
context 'when initialized with qualified_name: a Symbol' do
|
1170
1053
|
let(:qualified_name) { :'path/to/books' }
|
1171
1054
|
let(:constructor_options) do
|
1172
|
-
super().merge(qualified_name:
|
1055
|
+
super().merge(qualified_name:)
|
1173
1056
|
end
|
1174
1057
|
|
1175
1058
|
it { expect(subject.qualified_name).to be == qualified_name.to_s }
|
@@ -1337,7 +1220,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1337
1220
|
context 'when initialized with primary_key_name: a String' do
|
1338
1221
|
let(:primary_key_name) { 'uuid' }
|
1339
1222
|
let(:constructor_options) do
|
1340
|
-
super().merge(primary_key_name:
|
1223
|
+
super().merge(primary_key_name:)
|
1341
1224
|
end
|
1342
1225
|
|
1343
1226
|
it { expect(subject.primary_key_name).to be == primary_key_name }
|
@@ -1346,7 +1229,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1346
1229
|
context 'when initialized with primary_key_name: a Symbol' do
|
1347
1230
|
let(:primary_key_name) { :uuid }
|
1348
1231
|
let(:constructor_options) do
|
1349
|
-
super().merge(primary_key_name:
|
1232
|
+
super().merge(primary_key_name:)
|
1350
1233
|
end
|
1351
1234
|
|
1352
1235
|
it 'should set the primary key name' do
|
@@ -1369,7 +1252,7 @@ module Cuprum::Collections::RSpec::Contracts
|
|
1369
1252
|
context 'when initialized with primary_key_type: value' do
|
1370
1253
|
let(:primary_key_type) { String }
|
1371
1254
|
let(:constructor_options) do
|
1372
|
-
super().merge(primary_key_type:
|
1255
|
+
super().merge(primary_key_type:)
|
1373
1256
|
end
|
1374
1257
|
|
1375
1258
|
it { expect(subject.primary_key_type).to be == primary_key_type }
|