rom 3.3.3 → 4.0.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -599
- data/lib/rom/version.rb +1 -1
- data/lib/rom.rb +3 -44
- metadata +19 -295
- data/.gitignore +0 -24
- data/.rspec +0 -3
- data/.rubocop.yml +0 -87
- data/.rubocop_todo.yml +0 -46
- data/.travis.yml +0 -24
- data/.yardopts +0 -2
- data/CODE_OF_CONDUCT.md +0 -13
- data/CONTRIBUTING.md +0 -1
- data/Gemfile +0 -54
- data/Guardfile +0 -24
- data/Rakefile +0 -28
- data/lib/rom/array_dataset.rb +0 -44
- data/lib/rom/association_set.rb +0 -49
- data/lib/rom/auto_curry.rb +0 -55
- data/lib/rom/command.rb +0 -494
- data/lib/rom/command_registry.rb +0 -148
- data/lib/rom/commands/class_interface.rb +0 -270
- data/lib/rom/commands/composite.rb +0 -53
- data/lib/rom/commands/create.rb +0 -13
- data/lib/rom/commands/delete.rb +0 -14
- data/lib/rom/commands/graph/builder.rb +0 -176
- data/lib/rom/commands/graph/class_interface.rb +0 -62
- data/lib/rom/commands/graph/input_evaluator.rb +0 -62
- data/lib/rom/commands/graph.rb +0 -95
- data/lib/rom/commands/lazy/create.rb +0 -23
- data/lib/rom/commands/lazy/delete.rb +0 -27
- data/lib/rom/commands/lazy/update.rb +0 -34
- data/lib/rom/commands/lazy.rb +0 -99
- data/lib/rom/commands/result.rb +0 -96
- data/lib/rom/commands/update.rb +0 -14
- data/lib/rom/commands.rb +0 -3
- data/lib/rom/configuration.rb +0 -90
- data/lib/rom/configuration_dsl/command.rb +0 -41
- data/lib/rom/configuration_dsl/command_dsl.rb +0 -35
- data/lib/rom/configuration_dsl/mapper.rb +0 -36
- data/lib/rom/configuration_dsl/mapper_dsl.rb +0 -43
- data/lib/rom/configuration_dsl/relation.rb +0 -26
- data/lib/rom/configuration_dsl.rb +0 -107
- data/lib/rom/configuration_plugin.rb +0 -17
- data/lib/rom/constants.rb +0 -36
- data/lib/rom/container.rb +0 -233
- data/lib/rom/create_container.rb +0 -60
- data/lib/rom/data_proxy.rb +0 -94
- data/lib/rom/enumerable_dataset.rb +0 -68
- data/lib/rom/environment.rb +0 -70
- data/lib/rom/gateway.rb +0 -196
- data/lib/rom/global/plugin_dsl.rb +0 -47
- data/lib/rom/global.rb +0 -58
- data/lib/rom/initializer.rb +0 -26
- data/lib/rom/lint/enumerable_dataset.rb +0 -54
- data/lib/rom/lint/gateway.rb +0 -120
- data/lib/rom/lint/linter.rb +0 -78
- data/lib/rom/lint/spec.rb +0 -20
- data/lib/rom/lint/test.rb +0 -98
- data/lib/rom/mapper_registry.rb +0 -35
- data/lib/rom/memory/commands.rb +0 -56
- data/lib/rom/memory/dataset.rb +0 -97
- data/lib/rom/memory/gateway.rb +0 -64
- data/lib/rom/memory/relation.rb +0 -62
- data/lib/rom/memory/schema.rb +0 -13
- data/lib/rom/memory/storage.rb +0 -59
- data/lib/rom/memory/types.rb +0 -9
- data/lib/rom/memory.rb +0 -4
- data/lib/rom/pipeline.rb +0 -122
- data/lib/rom/plugin.rb +0 -20
- data/lib/rom/plugin_base.rb +0 -40
- data/lib/rom/plugin_registry.rb +0 -173
- data/lib/rom/plugins/command/schema.rb +0 -37
- data/lib/rom/plugins/configuration/configuration_dsl.rb +0 -21
- data/lib/rom/plugins/relation/instrumentation.rb +0 -51
- data/lib/rom/plugins/relation/key_inference.rb +0 -48
- data/lib/rom/plugins/relation/registry_reader.rb +0 -33
- data/lib/rom/registry.rb +0 -50
- data/lib/rom/relation/class_interface.rb +0 -356
- data/lib/rom/relation/composite.rb +0 -46
- data/lib/rom/relation/curried.rb +0 -109
- data/lib/rom/relation/graph.rb +0 -125
- data/lib/rom/relation/loaded.rb +0 -127
- data/lib/rom/relation/materializable.rb +0 -66
- data/lib/rom/relation/name.rb +0 -102
- data/lib/rom/relation/view_dsl.rb +0 -64
- data/lib/rom/relation.rb +0 -250
- data/lib/rom/relation_registry.rb +0 -9
- data/lib/rom/schema/attribute.rb +0 -390
- data/lib/rom/schema/dsl.rb +0 -67
- data/lib/rom/schema.rb +0 -407
- data/lib/rom/setup/auto_registration.rb +0 -74
- data/lib/rom/setup/auto_registration_strategies/base.rb +0 -16
- data/lib/rom/setup/auto_registration_strategies/custom_namespace.rb +0 -63
- data/lib/rom/setup/auto_registration_strategies/no_namespace.rb +0 -20
- data/lib/rom/setup/auto_registration_strategies/with_namespace.rb +0 -18
- data/lib/rom/setup/finalize/finalize_commands.rb +0 -47
- data/lib/rom/setup/finalize/finalize_mappers.rb +0 -36
- data/lib/rom/setup/finalize/finalize_relations.rb +0 -83
- data/lib/rom/setup/finalize.rb +0 -152
- data/lib/rom/setup.rb +0 -65
- data/lib/rom/support/configurable.rb +0 -85
- data/lib/rom/transaction.rb +0 -24
- data/lib/rom/types.rb +0 -49
- data/log/.gitkeep +0 -0
- data/rakelib/benchmark.rake +0 -15
- data/rakelib/mutant.rake +0 -19
- data/rakelib/rubocop.rake +0 -18
- data/rom.gemspec +0 -25
- data/spec/fixtures/app/commands/create_user.rb +0 -2
- data/spec/fixtures/app/mappers/user_list.rb +0 -2
- data/spec/fixtures/app/my_commands/create_user.rb +0 -2
- data/spec/fixtures/app/my_mappers/user_list.rb +0 -2
- data/spec/fixtures/app/my_relations/users.rb +0 -2
- data/spec/fixtures/app/relations/users.rb +0 -2
- data/spec/fixtures/custom/commands/create_user.rb +0 -6
- data/spec/fixtures/custom/mappers/user_list.rb +0 -6
- data/spec/fixtures/custom/relations/users.rb +0 -6
- data/spec/fixtures/custom_namespace/commands/create_customer.rb +0 -8
- data/spec/fixtures/custom_namespace/mappers/customer_list.rb +0 -8
- data/spec/fixtures/custom_namespace/relations/customers.rb +0 -8
- data/spec/fixtures/lib/persistence/commands/create_user.rb +0 -6
- data/spec/fixtures/lib/persistence/mappers/user_list.rb +0 -6
- data/spec/fixtures/lib/persistence/my_commands/create_user.rb +0 -6
- data/spec/fixtures/lib/persistence/my_mappers/user_list.rb +0 -6
- data/spec/fixtures/lib/persistence/my_relations/users.rb +0 -6
- data/spec/fixtures/lib/persistence/relations/users.rb +0 -6
- data/spec/fixtures/wrong/commands/create_customer.rb +0 -8
- data/spec/fixtures/wrong/mappers/customer_list.rb +0 -8
- data/spec/fixtures/wrong/relations/customers.rb +0 -8
- data/spec/integration/command_registry_spec.rb +0 -47
- data/spec/integration/commands/create_spec.rb +0 -157
- data/spec/integration/commands/delete_spec.rb +0 -67
- data/spec/integration/commands/error_handling_spec.rb +0 -25
- data/spec/integration/commands/graph_builder_spec.rb +0 -213
- data/spec/integration/commands/graph_spec.rb +0 -294
- data/spec/integration/commands/update_spec.rb +0 -86
- data/spec/integration/commands_spec.rb +0 -67
- data/spec/integration/gateways/extending_relations_spec.rb +0 -58
- data/spec/integration/gateways/setting_logger_spec.rb +0 -34
- data/spec/integration/mappers/combine_spec.rb +0 -117
- data/spec/integration/mappers/deep_embedded_spec.rb +0 -44
- data/spec/integration/mappers/definition_dsl_spec.rb +0 -206
- data/spec/integration/mappers/embedded_spec.rb +0 -62
- data/spec/integration/mappers/exclude_spec.rb +0 -27
- data/spec/integration/mappers/fold_spec.rb +0 -71
- data/spec/integration/mappers/group_spec.rb +0 -163
- data/spec/integration/mappers/overwrite_attributes_value_spec.rb +0 -51
- data/spec/integration/mappers/prefix_separator_spec.rb +0 -52
- data/spec/integration/mappers/prefix_spec.rb +0 -48
- data/spec/integration/mappers/prefixing_attributes_spec.rb +0 -37
- data/spec/integration/mappers/registering_custom_mappers_spec.rb +0 -28
- data/spec/integration/mappers/renaming_attributes_spec.rb +0 -125
- data/spec/integration/mappers/reusing_mappers_spec.rb +0 -43
- data/spec/integration/mappers/step_spec.rb +0 -119
- data/spec/integration/mappers/symbolizing_attributes_spec.rb +0 -77
- data/spec/integration/mappers/unfold_spec.rb +0 -92
- data/spec/integration/mappers/ungroup_spec.rb +0 -126
- data/spec/integration/mappers/unwrap_spec.rb +0 -93
- data/spec/integration/mappers/wrap_spec.rb +0 -155
- data/spec/integration/memory/commands/create_spec.rb +0 -23
- data/spec/integration/memory/commands/delete_spec.rb +0 -23
- data/spec/integration/memory/commands/update_spec.rb +0 -23
- data/spec/integration/multi_env_spec.rb +0 -69
- data/spec/integration/multi_repo_spec.rb +0 -46
- data/spec/integration/relations/default_dataset_spec.rb +0 -38
- data/spec/integration/relations/inheritance_spec.rb +0 -37
- data/spec/integration/relations/reading_spec.rb +0 -169
- data/spec/integration/relations/registry_dsl_spec.rb +0 -45
- data/spec/integration/setup_spec.rb +0 -193
- data/spec/shared/command_behavior.rb +0 -28
- data/spec/shared/command_graph.rb +0 -54
- data/spec/shared/container.rb +0 -9
- data/spec/shared/enumerable_dataset.rb +0 -52
- data/spec/shared/gateway_only.rb +0 -6
- data/spec/shared/materializable.rb +0 -36
- data/spec/shared/no_container.rb +0 -16
- data/spec/shared/one_behavior.rb +0 -26
- data/spec/shared/proxy.rb +0 -0
- data/spec/shared/users_and_tasks.rb +0 -10
- data/spec/spec_helper.rb +0 -59
- data/spec/support/constant_leak_finder.rb +0 -14
- data/spec/support/mutant.rb +0 -10
- data/spec/support/schema.rb +0 -14
- data/spec/support/types.rb +0 -5
- data/spec/test/memory_repository_lint_test.rb +0 -27
- data/spec/unit/rom/array_dataset_spec.rb +0 -59
- data/spec/unit/rom/association_set_spec.rb +0 -48
- data/spec/unit/rom/auto_curry_spec.rb +0 -71
- data/spec/unit/rom/commands/graph_spec.rb +0 -192
- data/spec/unit/rom/commands/lazy_spec.rb +0 -310
- data/spec/unit/rom/commands/pre_and_post_processors_spec.rb +0 -343
- data/spec/unit/rom/commands/result_spec.rb +0 -70
- data/spec/unit/rom/commands_spec.rb +0 -188
- data/spec/unit/rom/configurable_spec.rb +0 -49
- data/spec/unit/rom/configuration_spec.rb +0 -61
- data/spec/unit/rom/container_spec.rb +0 -109
- data/spec/unit/rom/create_container_spec.rb +0 -151
- data/spec/unit/rom/enumerable_dataset_spec.rb +0 -15
- data/spec/unit/rom/environment_spec.rb +0 -123
- data/spec/unit/rom/gateway_spec.rb +0 -146
- data/spec/unit/rom/mapper_registry_spec.rb +0 -25
- data/spec/unit/rom/memory/commands_spec.rb +0 -43
- data/spec/unit/rom/memory/dataset_spec.rb +0 -31
- data/spec/unit/rom/memory/gateway_spec.rb +0 -12
- data/spec/unit/rom/memory/inheritance_spec.rb +0 -32
- data/spec/unit/rom/memory/relation_spec.rb +0 -121
- data/spec/unit/rom/memory/storage_spec.rb +0 -45
- data/spec/unit/rom/plugin_spec.rb +0 -150
- data/spec/unit/rom/plugins/command/schema_spec.rb +0 -66
- data/spec/unit/rom/plugins/relation/instrumentation_spec.rb +0 -44
- data/spec/unit/rom/plugins/relation/key_inference_spec.rb +0 -85
- data/spec/unit/rom/registry_spec.rb +0 -86
- data/spec/unit/rom/relation/attribute_reader_spec.rb +0 -17
- data/spec/unit/rom/relation/call_spec.rb +0 -51
- data/spec/unit/rom/relation/composite_spec.rb +0 -106
- data/spec/unit/rom/relation/curried_spec.rb +0 -67
- data/spec/unit/rom/relation/graph_spec.rb +0 -106
- data/spec/unit/rom/relation/lazy/combine_spec.rb +0 -165
- data/spec/unit/rom/relation/lazy/graph_spec.rb +0 -165
- data/spec/unit/rom/relation/lazy_spec.rb +0 -214
- data/spec/unit/rom/relation/loaded_spec.rb +0 -53
- data/spec/unit/rom/relation/name_spec.rb +0 -58
- data/spec/unit/rom/relation/output_schema_spec.rb +0 -28
- data/spec/unit/rom/relation/schema_spec.rb +0 -259
- data/spec/unit/rom/relation/view_spec.rb +0 -158
- data/spec/unit/rom/relation_spec.rb +0 -252
- data/spec/unit/rom/schema/accessing_attributes_spec.rb +0 -52
- data/spec/unit/rom/schema/append_spec.rb +0 -17
- data/spec/unit/rom/schema/exclude_spec.rb +0 -15
- data/spec/unit/rom/schema/finalize_spec.rb +0 -59
- data/spec/unit/rom/schema/key_predicate_spec.rb +0 -15
- data/spec/unit/rom/schema/merge_spec.rb +0 -17
- data/spec/unit/rom/schema/prefix_spec.rb +0 -16
- data/spec/unit/rom/schema/project_spec.rb +0 -15
- data/spec/unit/rom/schema/rename_spec.rb +0 -22
- data/spec/unit/rom/schema/type_spec.rb +0 -49
- data/spec/unit/rom/schema/uniq_spec.rb +0 -21
- data/spec/unit/rom/schema/wrap_spec.rb +0 -18
- data/spec/unit/rom/schema_spec.rb +0 -10
- data/spec/unit/rom/setup/auto_registration_spec.rb +0 -214
@@ -1,21 +0,0 @@
|
|
1
|
-
require 'rom/schema'
|
2
|
-
|
3
|
-
RSpec.describe ROM::Schema, '#uniq' do
|
4
|
-
subject(:schema) { left.merge(right) }
|
5
|
-
|
6
|
-
let(:left) do
|
7
|
-
define_schema(:users, id: :Int, name: :String)
|
8
|
-
end
|
9
|
-
|
10
|
-
let(:right) do
|
11
|
-
define_schema(:tasks, id: :Int, user_id: :Int)
|
12
|
-
end
|
13
|
-
|
14
|
-
it 'returns a new schema with unique attributes from two schemas' do
|
15
|
-
expect(schema.uniq.map(&:name)).to eql(%i[id name user_id])
|
16
|
-
end
|
17
|
-
|
18
|
-
it 'accepts a block' do
|
19
|
-
expect(schema.uniq(&:primitive).map(&:name)).to eql(%i[id name])
|
20
|
-
end
|
21
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
require 'rom/schema'
|
2
|
-
|
3
|
-
RSpec.describe ROM::Schema, '#wrap' do
|
4
|
-
subject(:schema) do
|
5
|
-
define_schema(:users, id: :Int, name: :String)
|
6
|
-
end
|
7
|
-
|
8
|
-
let(:wrapped) do
|
9
|
-
schema.wrap(:users)
|
10
|
-
end
|
11
|
-
|
12
|
-
it 'returns projected schema with renamed attributes using provided prefix' do
|
13
|
-
expect(wrapped.map(&:alias)).to eql(%i[users_id users_name])
|
14
|
-
expect(wrapped.map { |attr| attr.meta[:name] }).to eql(%i[id name])
|
15
|
-
expect(wrapped.all?(&:wrapped?)).to be(true)
|
16
|
-
expect(wrapped.wrap(:foo)).to eql(wrapped)
|
17
|
-
end
|
18
|
-
end
|
@@ -1,10 +0,0 @@
|
|
1
|
-
RSpec.describe ROM::Schema do
|
2
|
-
describe '#to_h' do
|
3
|
-
it 'returns hash with attributes' do
|
4
|
-
attrs = { id: ROM::Types::Int.meta(name: :id), name: ROM::Types::String.meta(name: :name) }
|
5
|
-
schema = ROM::Schema.define(:name, attributes: attrs.values)
|
6
|
-
|
7
|
-
expect(schema.to_h).to eql(attrs)
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|
@@ -1,214 +0,0 @@
|
|
1
|
-
require 'rom/setup'
|
2
|
-
|
3
|
-
RSpec.describe ROM::Setup, '#auto_registration' do
|
4
|
-
subject(:setup) { ROM::Setup.new }
|
5
|
-
|
6
|
-
context 'with default component_dirs' do
|
7
|
-
context 'with namespace turned on' do
|
8
|
-
before do
|
9
|
-
setup.auto_registration(SPEC_ROOT.join('fixtures/lib/persistence').to_s)
|
10
|
-
end
|
11
|
-
|
12
|
-
describe '#relations' do
|
13
|
-
it 'loads files and returns constants' do
|
14
|
-
expect(setup.relation_classes).to eql([Persistence::Relations::Users])
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
describe '#commands' do
|
19
|
-
it 'loads files and returns constants' do
|
20
|
-
expect(setup.command_classes).to eql([Persistence::Commands::CreateUser])
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
describe '#mappers' do
|
25
|
-
it 'loads files and returns constants' do
|
26
|
-
expect(setup.mapper_classes).to eql([Persistence::Mappers::UserList])
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
context 'with namespace turned off' do
|
32
|
-
before do
|
33
|
-
setup.auto_registration(SPEC_ROOT.join('fixtures/app'), namespace: false)
|
34
|
-
end
|
35
|
-
|
36
|
-
describe '#relations' do
|
37
|
-
it 'loads files and returns constants' do
|
38
|
-
expect(setup.relation_classes).to eql([Users])
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
describe '#commands' do
|
43
|
-
it 'loads files and returns constants' do
|
44
|
-
expect(setup.command_classes).to eql([CreateUser])
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
describe '#mappers' do
|
49
|
-
it 'loads files and returns constants' do
|
50
|
-
expect(setup.mapper_classes).to eql([UserList])
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
context 'with custom component_dirs' do
|
57
|
-
context 'with namespace turned on' do
|
58
|
-
before do
|
59
|
-
setup.auto_registration(
|
60
|
-
SPEC_ROOT.join('fixtures/lib/persistence').to_s,
|
61
|
-
component_dirs: {
|
62
|
-
relations: :my_relations,
|
63
|
-
mappers: :my_mappers,
|
64
|
-
commands: :my_commands
|
65
|
-
}
|
66
|
-
)
|
67
|
-
end
|
68
|
-
|
69
|
-
describe '#relations' do
|
70
|
-
it 'loads files and returns constants' do
|
71
|
-
expect(setup.relation_classes).to eql([Persistence::MyRelations::Users])
|
72
|
-
end
|
73
|
-
end
|
74
|
-
|
75
|
-
describe '#commands' do
|
76
|
-
it 'loads files and returns constants' do
|
77
|
-
expect(setup.command_classes).to eql([Persistence::MyCommands::CreateUser])
|
78
|
-
end
|
79
|
-
end
|
80
|
-
|
81
|
-
describe '#mappers' do
|
82
|
-
it 'loads files and returns constants' do
|
83
|
-
expect(setup.mapper_classes).to eql([Persistence::MyMappers::UserList])
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
context 'with namespace turned off' do
|
89
|
-
before do
|
90
|
-
setup.auto_registration(
|
91
|
-
SPEC_ROOT.join('fixtures/app'),
|
92
|
-
component_dirs: {
|
93
|
-
relations: :my_relations,
|
94
|
-
mappers: :my_mappers,
|
95
|
-
commands: :my_commands
|
96
|
-
},
|
97
|
-
namespace: false
|
98
|
-
)
|
99
|
-
end
|
100
|
-
|
101
|
-
describe '#relations' do
|
102
|
-
it 'loads files and returns constants' do
|
103
|
-
expect(setup.relation_classes).to eql([Users])
|
104
|
-
end
|
105
|
-
end
|
106
|
-
|
107
|
-
describe '#commands' do
|
108
|
-
it 'loads files and returns constants' do
|
109
|
-
expect(setup.command_classes).to eql([CreateUser])
|
110
|
-
end
|
111
|
-
end
|
112
|
-
|
113
|
-
describe '#mappers' do
|
114
|
-
it 'loads files and returns constants' do
|
115
|
-
expect(setup.mapper_classes).to eql([UserList])
|
116
|
-
end
|
117
|
-
end
|
118
|
-
end
|
119
|
-
|
120
|
-
describe 'custom namespace' do
|
121
|
-
context 'when namespace has subnamespace' do
|
122
|
-
before do
|
123
|
-
setup.auto_registration(
|
124
|
-
SPEC_ROOT.join('fixtures/custom_namespace'),
|
125
|
-
component_dirs: {
|
126
|
-
relations: :relations,
|
127
|
-
mappers: :mappers,
|
128
|
-
commands: :commands
|
129
|
-
},
|
130
|
-
namespace: 'My::Namespace'
|
131
|
-
)
|
132
|
-
end
|
133
|
-
|
134
|
-
describe '#relations' do
|
135
|
-
it 'loads files and returns constants' do
|
136
|
-
expect(setup.relation_classes).to eql([My::Namespace::Relations::Customers])
|
137
|
-
end
|
138
|
-
end
|
139
|
-
|
140
|
-
describe '#commands' do
|
141
|
-
it 'loads files and returns constants' do
|
142
|
-
expect(setup.command_classes).to eql([My::Namespace::Commands::CreateCustomer])
|
143
|
-
end
|
144
|
-
end
|
145
|
-
|
146
|
-
describe '#mappers' do
|
147
|
-
it 'loads files and returns constants' do
|
148
|
-
expect(setup.mapper_classes).to eql([My::Namespace::Mappers::CustomerList])
|
149
|
-
end
|
150
|
-
end
|
151
|
-
end
|
152
|
-
|
153
|
-
context 'when namespace has wrong subnamespace' do
|
154
|
-
subject do
|
155
|
-
-> do
|
156
|
-
setup.auto_registration(
|
157
|
-
SPEC_ROOT.join('fixtures/wrong'),
|
158
|
-
component_dirs: {
|
159
|
-
relations: :relations,
|
160
|
-
mappers: :mappers,
|
161
|
-
commands: :commands
|
162
|
-
},
|
163
|
-
namespace: 'My::NewNamespace'
|
164
|
-
)
|
165
|
-
end
|
166
|
-
end
|
167
|
-
|
168
|
-
describe '#relations' do
|
169
|
-
it { is_expected.to raise_exception NameError }
|
170
|
-
end
|
171
|
-
|
172
|
-
describe '#commands' do
|
173
|
-
it { is_expected.to raise_exception NameError }
|
174
|
-
end
|
175
|
-
|
176
|
-
describe '#mappers' do
|
177
|
-
it { is_expected.to raise_exception NameError }
|
178
|
-
end
|
179
|
-
end
|
180
|
-
|
181
|
-
context 'when namespace does not implement subnamespace' do
|
182
|
-
before do
|
183
|
-
setup.auto_registration(
|
184
|
-
SPEC_ROOT.join('fixtures/custom'),
|
185
|
-
component_dirs: {
|
186
|
-
relations: :relations,
|
187
|
-
mappers: :mappers,
|
188
|
-
commands: :commands
|
189
|
-
},
|
190
|
-
namespace: 'My::Namespace'
|
191
|
-
)
|
192
|
-
end
|
193
|
-
|
194
|
-
describe '#relations' do
|
195
|
-
it 'loads files and returns constants' do
|
196
|
-
expect(setup.relation_classes).to eql([My::Namespace::Users])
|
197
|
-
end
|
198
|
-
end
|
199
|
-
|
200
|
-
describe '#commands' do
|
201
|
-
it 'loads files and returns constants' do
|
202
|
-
expect(setup.command_classes).to eql([My::Namespace::CreateUser])
|
203
|
-
end
|
204
|
-
end
|
205
|
-
|
206
|
-
describe '#mappers' do
|
207
|
-
it 'loads files and returns constants' do
|
208
|
-
expect(setup.mapper_classes).to eql([My::Namespace::UserList])
|
209
|
-
end
|
210
|
-
end
|
211
|
-
end
|
212
|
-
end
|
213
|
-
end
|
214
|
-
end
|