module-cluster 1.3.1 → 1.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. data/lib/module-cluster.rb +17 -13
  2. data/lib/module-cluster/ModuleCluster.rb +8 -8
  3. data/lib/module-cluster/ModuleCluster/CascadeFeatures.rb +155 -0
  4. data/lib/module-cluster/ModuleCluster/ClusterStack.rb +102 -0
  5. data/lib/module-cluster/ModuleCluster/Define/Cluster.rb +203 -0
  6. data/lib/module-cluster/ModuleCluster/Define/ClusterCascades.rb +220 -0
  7. data/lib/module-cluster/ModuleCluster/Define/ClusterCascadesToClass.rb +209 -0
  8. data/lib/module-cluster/ModuleCluster/Define/ClusterCascadesToModule.rb +209 -0
  9. data/lib/module-cluster/ModuleCluster/Define/ClusterStack.rb +26 -0
  10. data/lib/module-cluster/ModuleCluster/Define/DedoubleAncestors.rb +22 -0
  11. data/lib/module-cluster/ModuleCluster/ExtendForCascade.rb +15 -0
  12. data/spec/ModuleCluster/Define/ClusterCascadesToClass_spec.rb +421 -0
  13. data/spec/ModuleCluster/Define/ClusterCascadesToModule_spec.rb +432 -0
  14. data/spec/ModuleCluster/Define/ClusterCascades_spec.rb +345 -0
  15. data/spec/ModuleCluster/Define/Cluster_spec.rb +275 -0
  16. data/spec/ModuleCluster_spec.rb +4 -4
  17. metadata +16 -14
  18. data/lib/module-cluster/ModuleCluster/Define/ModuleCluster.rb +0 -211
  19. data/lib/module-cluster/ModuleCluster/Define/ModuleClusterCascades.rb +0 -223
  20. data/lib/module-cluster/ModuleCluster/Define/ModuleClusterCascadesToClass.rb +0 -223
  21. data/lib/module-cluster/ModuleCluster/Define/ModuleClusterCascadesToModule.rb +0 -227
  22. data/lib/module-cluster/ModuleCluster/Define/_private_/AnonymousModule.rb +0 -121
  23. data/lib/module-cluster/ModuleCluster/Define/_private_/ClusterStack.rb +0 -55
  24. data/spec/ModuleCluster/Define/ModuleClusterCascadesToClass_spec.rb +0 -421
  25. data/spec/ModuleCluster/Define/ModuleClusterCascadesToModule_spec.rb +0 -432
  26. data/spec/ModuleCluster/Define/ModuleClusterCascades_spec.rb +0 -345
  27. data/spec/ModuleCluster/Define/ModuleCluster_spec.rb +0 -275
  28. data/spec/ModuleCluster/Define/_private_/ClusterStack_spec.rb +0 -24
@@ -1,121 +0,0 @@
1
-
2
- module ModuleCluster::Define::AnonymousModule
3
-
4
- ###########################################################################################################
5
- private ###############################################################################################
6
- ###########################################################################################################
7
-
8
- include ModuleCluster::Define::ClusterStack
9
-
10
- ##########################################
11
- # anonymous_module_for_append_features #
12
- ##########################################
13
-
14
- def anonymous_module_for_append_features( subset_string = '', & method_block )
15
-
16
- module_instance = Module.new do
17
-
18
- #-------------------#
19
- # append_features #
20
- #-------------------#
21
-
22
- define_method( :append_features ) do |class_or_module|
23
- class_or_module.module_eval( & method_block )
24
- super( class_or_module )
25
- end
26
-
27
- end
28
-
29
- set_anonymous_module_constant( 'AppendFeatures' + subset_string, module_instance )
30
-
31
- return module_instance
32
-
33
- end
34
-
35
- ###################################
36
- # anonymous_module_for_included #
37
- ###################################
38
-
39
- def anonymous_module_for_included( subset_string = '', & method_block )
40
-
41
- module_instance = Module.new do
42
-
43
- #------------#
44
- # included #
45
- #------------#
46
-
47
- define_method( :included ) do |class_or_module|
48
- super( class_or_module )
49
- class_or_module.module_eval( & method_block )
50
- end
51
-
52
- end
53
-
54
- set_anonymous_module_constant( 'Included' + subset_string, module_instance )
55
-
56
- return module_instance
57
-
58
- end
59
-
60
- ########################################
61
- # anonymous_module_for_extend_object #
62
- ########################################
63
-
64
- def anonymous_module_for_extend_object( subset_string = '', & method_block )
65
-
66
- module_instance = Module.new do
67
-
68
- #-----------------#
69
- # extend_object #
70
- #-----------------#
71
-
72
- define_method( :extend_object ) do |class_or_module|
73
- class_or_module.module_eval( & method_block )
74
- super( class_or_module )
75
- end
76
-
77
- end
78
-
79
- set_anonymous_module_constant( 'ExtendObject' + subset_string, module_instance )
80
-
81
- return module_instance
82
-
83
- end
84
-
85
- ###################################
86
- # anonymous_module_for_extended #
87
- ###################################
88
-
89
- def anonymous_module_for_extended( subset_string = '', & method_block )
90
-
91
- module_instance = Module.new do
92
-
93
- #------------#
94
- # extended #
95
- #------------#
96
-
97
- define_method( :extended ) do |class_or_module|
98
- super( class_or_module )
99
- class_or_module.module_eval( & method_block )
100
- end
101
-
102
- end
103
-
104
- set_anonymous_module_constant( 'Included' + subset_string, module_instance )
105
-
106
- return module_instance
107
-
108
- end
109
-
110
- ###################################
111
- # set_anonymous_module_constant #
112
- ###################################
113
-
114
- def set_anonymous_module_constant( base_name, module_instance )
115
-
116
- module_constant_name = ( base_name << clusterstack_module.increment_stack_count.to_s ).to_sym
117
- const_set( module_constant_name, module_instance )
118
-
119
- end
120
-
121
- end
@@ -1,55 +0,0 @@
1
-
2
- module ModuleCluster::Define::ClusterStack
3
-
4
- ###########################################################################################################
5
- private ###############################################################################################
6
- ###########################################################################################################
7
-
8
- ################
9
- # eigenclass #
10
- ################
11
-
12
- def eigenclass
13
- return class << self ; self ; end
14
- end
15
-
16
- #########################
17
- # clusterstack_module #
18
- #########################
19
-
20
- def clusterstack_module( & clusterstack_extend_include_block )
21
-
22
- module_instance = nil
23
-
24
- unless const_defined?( :ClusterStackModule ) and module_instance = const_get( :ClusterStackModule )
25
-
26
- module_instance = Module.new do
27
-
28
- #-------------------------#
29
- # increment_stack_count #
30
- #-------------------------#
31
-
32
- def self.increment_stack_count
33
- @stack_count ||= 0
34
- @stack_count += 1
35
- return @stack_count
36
- end
37
-
38
- end
39
-
40
- const_set( :ClusterStackModule, module_instance )
41
-
42
- end
43
-
44
- # we use a block so that we don't have to worry about manually re-extending each time
45
- if block_given?
46
- module_instance.module_eval( & clusterstack_extend_include_block )
47
- # we have to re-extend each time so that new includes/extends apply to self
48
- extend( module_instance )
49
- end
50
-
51
- return module_instance
52
-
53
- end
54
-
55
- end
@@ -1,421 +0,0 @@
1
-
2
- require_relative '../../../lib/module-cluster.rb'
3
-
4
- describe ModuleCluster::Define::ModuleClusterCascadesToClass do
5
-
6
- ########################################
7
- # include_cascades_includes_to_class #
8
- ########################################
9
-
10
- it 'include modules for any class this module or any including modules are included in' do
11
- module ModuleCluster::Define::ModuleClusterCascadesToClass::Mock01
12
- extend ModuleCluster::Define::ModuleClusterCascadesToClass
13
- module Module1
14
- end
15
- module Module2
16
- end
17
- include_cascades_includes_to_class( Module1, Module2 )
18
- respond_to?( :included ).should == true
19
- module Proof1
20
- include ModuleCluster::Define::ModuleClusterCascadesToClass::Mock01
21
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock01::Module1 ).should == false
22
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock01::Module2 ).should == false
23
- end
24
- module Proof2
25
- include ModuleCluster::Define::ModuleClusterCascadesToClass::Mock01::Proof1
26
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock01::Module1 ).should == false
27
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock01::Module2 ).should == false
28
- end
29
- class Proof3
30
- include ModuleCluster::Define::ModuleClusterCascadesToClass::Mock01::Proof2
31
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock01::Module1 ).should == true
32
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock01::Module2 ).should == true
33
- end
34
- end
35
- end
36
-
37
- #######################################
38
- # include_cascades_extends_to_class #
39
- #######################################
40
-
41
- it 'extends modules for any class this module or any including modules are included in' do
42
- module ModuleCluster::Define::ModuleClusterCascadesToClass::Mock02
43
- extend ModuleCluster::Define::ModuleClusterCascadesToClass
44
- module Module1
45
- end
46
- module Module2
47
- end
48
- include_cascades_extends_to_class( Module1, Module2 )
49
- respond_to?( :included ).should == true
50
- module Proof1
51
- include ModuleCluster::Define::ModuleClusterCascadesToClass::Mock02
52
- eigenclass = class << self ; self ; end
53
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock02::Module1 ).should == false
54
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock02::Module2 ).should == false
55
- end
56
- module Proof2
57
- include ModuleCluster::Define::ModuleClusterCascadesToClass::Mock02::Proof1
58
- eigenclass = class << self ; self ; end
59
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock02::Module1 ).should == false
60
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock02::Module2 ).should == false
61
- end
62
- class Proof3
63
- include ModuleCluster::Define::ModuleClusterCascadesToClass::Mock02::Proof2
64
- eigenclass = class << self ; self ; end
65
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock02::Module1 ).should == true
66
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock02::Module2 ).should == true
67
- end
68
- end
69
- end
70
-
71
- ####################################################
72
- # include_cascades_includes_and_extends_to_class #
73
- ####################################################
74
-
75
- it 'include and extends modules for any class this module or any including modules are included in' do
76
- module ModuleCluster::Define::ModuleClusterCascadesToClass::Mock03
77
- extend ModuleCluster::Define::ModuleClusterCascadesToClass
78
- module Module1
79
- end
80
- module Module2
81
- end
82
- include_cascades_includes_and_extends_to_class( Module1, Module2 )
83
- respond_to?( :included ).should == true
84
- module Proof1
85
- include ModuleCluster::Define::ModuleClusterCascadesToClass::Mock03
86
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock03::Module1 ).should == false
87
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock03::Module2 ).should == false
88
- eigenclass = class << self ; self ; end
89
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock03::Module1 ).should == false
90
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock03::Module2 ).should == false
91
- end
92
- module Proof2
93
- include ModuleCluster::Define::ModuleClusterCascadesToClass::Mock03::Proof1
94
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock03::Module1 ).should == false
95
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock03::Module2 ).should == false
96
- eigenclass = class << self ; self ; end
97
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock03::Module1 ).should == false
98
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock03::Module2 ).should == false
99
- end
100
- class Proof3
101
- include ModuleCluster::Define::ModuleClusterCascadesToClass::Mock03::Proof2
102
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock03::Module1 ).should == true
103
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock03::Module2 ).should == true
104
- eigenclass = class << self ; self ; end
105
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock03::Module1 ).should == true
106
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock03::Module2 ).should == true
107
- end
108
- end
109
- end
110
-
111
- #######################################
112
- # extend_cascades_includes_to_class #
113
- #######################################
114
-
115
- it 'include modules for any class this module is extended in' do
116
- module ModuleCluster::Define::ModuleClusterCascadesToClass::Mock04
117
- extend ModuleCluster::Define::ModuleClusterCascadesToClass
118
- module Module1
119
- end
120
- module Module2
121
- end
122
- extend_cascades_includes_to_class( Module1, Module2 )
123
- respond_to?( :extended ).should == true
124
- module Proof1
125
- extend ModuleCluster::Define::ModuleClusterCascadesToClass::Mock04
126
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock04::Module1 ).should == false
127
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock04::Module2 ).should == false
128
- end
129
- module Proof2
130
- extend ModuleCluster::Define::ModuleClusterCascadesToClass::Mock04::Proof1
131
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock04::Module1 ).should == false
132
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock04::Module2 ).should == false
133
- end
134
- class Proof3
135
- extend ModuleCluster::Define::ModuleClusterCascadesToClass::Mock04::Proof2
136
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock04::Module1 ).should == true
137
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock04::Module2 ).should == true
138
- end
139
- end
140
- end
141
-
142
- ######################################
143
- # extend_cascades_extends_to_class #
144
- ######################################
145
-
146
- it 'extend modules for any class this module is extended in' do
147
- module ModuleCluster::Define::ModuleClusterCascadesToClass::Mock05
148
- extend ModuleCluster::Define::ModuleClusterCascadesToClass
149
- module Module1
150
- end
151
- module Module2
152
- end
153
- extend_cascades_extends_to_class( Module1, Module2 )
154
- respond_to?( :extended ).should == true
155
- module Proof1
156
- extend ModuleCluster::Define::ModuleClusterCascadesToClass::Mock05
157
- eigenclass = class << self ; self ; end
158
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock05::Module1 ).should == false
159
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock05::Module2 ).should == false
160
- end
161
- module Proof2
162
- extend ModuleCluster::Define::ModuleClusterCascadesToClass::Mock05::Proof1
163
- eigenclass = class << self ; self ; end
164
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock05::Module1 ).should == false
165
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock05::Module2 ).should == false
166
- end
167
- class Proof3
168
- extend ModuleCluster::Define::ModuleClusterCascadesToClass::Mock05::Proof2
169
- eigenclass = class << self ; self ; end
170
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock05::Module1 ).should == true
171
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock05::Module2 ).should == true
172
- end
173
- end
174
- end
175
-
176
- ###################################################
177
- # extend_cascades_includes_and_extends_to_class #
178
- ###################################################
179
-
180
- it 'include and extend modules for any class this module is extended in' do
181
- module ModuleCluster::Define::ModuleClusterCascadesToClass::Mock06
182
- extend ModuleCluster::Define::ModuleClusterCascadesToClass
183
- module Module1
184
- end
185
- module Module2
186
- end
187
- extend_cascades_includes_and_extends_to_class( Module1, Module2 )
188
- respond_to?( :extended ).should == true
189
- module Proof1
190
- extend ModuleCluster::Define::ModuleClusterCascadesToClass::Mock06
191
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock06::Module1 ).should == false
192
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock06::Module2 ).should == false
193
- eigenclass = class << self ; self ; end
194
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock06::Module1 ).should == false
195
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock06::Module2 ).should == false
196
- end
197
- module Proof2
198
- extend ModuleCluster::Define::ModuleClusterCascadesToClass::Mock06::Proof1
199
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock06::Module1 ).should == false
200
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock06::Module2 ).should == false
201
- eigenclass = class << self ; self ; end
202
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock06::Module1 ).should == false
203
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock06::Module2 ).should == false
204
- end
205
- class Proof3
206
- extend ModuleCluster::Define::ModuleClusterCascadesToClass::Mock06::Proof2
207
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock06::Module1 ).should == true
208
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock06::Module2 ).should == true
209
- eigenclass = class << self ; self ; end
210
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock06::Module1 ).should == true
211
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock06::Module2 ).should == true
212
- end
213
- end
214
- end
215
-
216
- ###################################################
217
- # include_cascades_to_class_prepending_includes #
218
- ###################################################
219
-
220
- it 'include other modules for any class this module or any including modules are included in, before this module or including module is included' do
221
- module ModuleCluster::Define::ModuleClusterCascadesToClass::Mock07
222
- extend ModuleCluster::Define::ModuleClusterCascadesToClass
223
- module Module1
224
- end
225
- module Module2
226
- end
227
- include_cascades_to_class_prepending_includes( Module1, Module2 )
228
- respond_to?( :append_features ).should == true
229
- module Proof1
230
- include ModuleCluster::Define::ModuleClusterCascadesToClass::Mock07
231
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock07::Module1 ).should == false
232
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock07::Module2 ).should == false
233
- end
234
- module Proof2
235
- include ModuleCluster::Define::ModuleClusterCascadesToClass::Mock07::Proof1
236
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock07::Module1 ).should == false
237
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock07::Module2 ).should == false
238
- end
239
- class Proof3
240
- include ModuleCluster::Define::ModuleClusterCascadesToClass::Mock07::Proof2
241
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock07::Module1 ).should == true
242
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock07::Module2 ).should == true
243
- end
244
- end
245
- end
246
-
247
- ##################################################
248
- # include_cascades_to_class_prepending_extends #
249
- ##################################################
250
-
251
- it 'extend other modules for any class this module or any including modules are included in, before this module or including module is included' do
252
- module ModuleCluster::Define::ModuleClusterCascadesToClass::Mock08
253
- extend ModuleCluster::Define::ModuleClusterCascadesToClass
254
- module Module1
255
- end
256
- module Module2
257
- end
258
- include_cascades_to_class_prepending_extends( Module1, Module2 )
259
- respond_to?( :append_features ).should == true
260
- module Proof1
261
- include ModuleCluster::Define::ModuleClusterCascadesToClass::Mock08
262
- eigenclass = class << self ; self ; end
263
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock08::Module1 ).should == false
264
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock08::Module2 ).should == false
265
- end
266
- module Proof2
267
- include ModuleCluster::Define::ModuleClusterCascadesToClass::Mock08::Proof1
268
- eigenclass = class << self ; self ; end
269
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock08::Module1 ).should == false
270
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock08::Module2 ).should == false
271
- end
272
- class Proof3
273
- include ModuleCluster::Define::ModuleClusterCascadesToClass::Mock08::Proof2
274
- eigenclass = class << self ; self ; end
275
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock08::Module1 ).should == true
276
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock08::Module2 ).should == true
277
- end
278
- end
279
- end
280
-
281
- ###############################################################
282
- # include_cascades_to_class_prepending_includes_and_extends #
283
- ###############################################################
284
-
285
- it 'include and extend other modules for any class this module or any including modules are included in, before this module or including module is included' do
286
- module ModuleCluster::Define::ModuleClusterCascadesToClass::Mock09
287
- extend ModuleCluster::Define::ModuleClusterCascadesToClass
288
- module Module1
289
- end
290
- module Module2
291
- end
292
- include_cascades_to_class_prepending_includes_and_extends( Module1, Module2 )
293
- respond_to?( :append_features ).should == true
294
- module Proof1
295
- include ModuleCluster::Define::ModuleClusterCascadesToClass::Mock09
296
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock09::Module1 ).should == false
297
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock09::Module2 ).should == false
298
- eigenclass = class << self ; self ; end
299
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock09::Module1 ).should == false
300
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock09::Module2 ).should == false
301
- end
302
- module Proof2
303
- include ModuleCluster::Define::ModuleClusterCascadesToClass::Mock09::Proof1
304
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock09::Module1 ).should == false
305
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock09::Module2 ).should == false
306
- eigenclass = class << self ; self ; end
307
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock09::Module1 ).should == false
308
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock09::Module2 ).should == false
309
- end
310
- class Proof3
311
- include ModuleCluster::Define::ModuleClusterCascadesToClass::Mock09::Proof2
312
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock09::Module1 ).should == true
313
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock09::Module2 ).should == true
314
- eigenclass = class << self ; self ; end
315
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock09::Module1 ).should == true
316
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock09::Module2 ).should == true
317
- end
318
- end
319
- end
320
-
321
- ##################################################
322
- # extend_cascades_to_class_prepending_includes #
323
- ##################################################
324
-
325
- it 'include other modules for any class this module or any including modules are included in, before this module is extended' do
326
- module ModuleCluster::Define::ModuleClusterCascadesToClass::Mock10
327
- extend ModuleCluster::Define::ModuleClusterCascadesToClass
328
- module Module1
329
- end
330
- module Module2
331
- end
332
- extend_cascades_to_class_prepending_includes( Module1, Module2 )
333
- respond_to?( :extend_object ).should == true
334
- module Proof1
335
- extend ModuleCluster::Define::ModuleClusterCascadesToClass::Mock10
336
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock10::Module1 ).should == false
337
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock10::Module2 ).should == false
338
- end
339
- module Proof2
340
- extend ModuleCluster::Define::ModuleClusterCascadesToClass::Mock10::Proof1
341
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock10::Module1 ).should == false
342
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock10::Module2 ).should == false
343
- end
344
- class Proof3
345
- extend ModuleCluster::Define::ModuleClusterCascadesToClass::Mock10::Proof2
346
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock10::Module1 ).should == true
347
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock10::Module2 ).should == true
348
- end
349
- end
350
- end
351
-
352
- #################################################
353
- # extend_cascades_to_class_prepending_extends #
354
- #################################################
355
-
356
- it 'extend other modules for any class this module or any including modules are included in, before this module is extended' do
357
- module ModuleCluster::Define::ModuleClusterCascadesToClass::Mock11
358
- extend ModuleCluster::Define::ModuleClusterCascadesToClass
359
- module Module1
360
- end
361
- module Module2
362
- end
363
- extend_cascades_to_class_prepending_extends( Module1, Module2 )
364
- respond_to?( :extend_object ).should == true
365
- module Proof1
366
- extend ModuleCluster::Define::ModuleClusterCascadesToClass::Mock11
367
- eigenclass = class << self ; self ; end
368
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock11::Module1 ).should == false
369
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock11::Module2 ).should == false
370
- end
371
- module Proof2
372
- extend ModuleCluster::Define::ModuleClusterCascadesToClass::Mock11::Proof1
373
- eigenclass = class << self ; self ; end
374
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock11::Module1 ).should == false
375
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock11::Module2 ).should == false
376
- end
377
- class Proof3
378
- extend ModuleCluster::Define::ModuleClusterCascadesToClass::Mock11::Proof2
379
- eigenclass = class << self ; self ; end
380
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock11::Module1 ).should == true
381
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock11::Module2 ).should == true
382
- end
383
- end
384
- end
385
-
386
- ##############################################################
387
- # extend_cascades_to_class_prepending_includes_and_extends #
388
- ##############################################################
389
-
390
- it 'include and extend other modules for any class this module or any including modules are included in, before this module is extended' do
391
- module ModuleCluster::Define::ModuleClusterCascadesToClass::Mock12
392
- extend ModuleCluster::Define::ModuleClusterCascadesToClass
393
- module Module1
394
- end
395
- module Module2
396
- end
397
- extend_cascades_to_class_prepending_includes_and_extends( Module1, Module2 )
398
- respond_to?( :extend_object ).should == true
399
- module Proof1
400
- extend ModuleCluster::Define::ModuleClusterCascadesToClass::Mock12
401
- end
402
- module Proof2
403
- extend ModuleCluster::Define::ModuleClusterCascadesToClass::Mock12::Proof1
404
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock12::Module1 ).should == false
405
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock12::Module2 ).should == false
406
- eigenclass = class << self ; self ; end
407
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock12::Module1 ).should == false
408
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock12::Module2 ).should == false
409
- end
410
- class Proof3
411
- extend ModuleCluster::Define::ModuleClusterCascadesToClass::Mock12::Proof2
412
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock12::Module1 ).should == true
413
- ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock12::Module2 ).should == true
414
- eigenclass = class << self ; self ; end
415
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock12::Module1 ).should == true
416
- eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToClass::Mock12::Module2 ).should == true
417
- end
418
- end
419
- end
420
-
421
- end