module-cluster 1.4.8 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. data/README.md +127 -337
  2. data/lib/module-cluster.rb +1 -153
  3. data/lib/module/cluster.rb +341 -0
  4. data/lib/module/cluster/class_support.rb +22 -0
  5. data/lib/module/cluster/cluster.rb +10 -0
  6. data/lib/module/cluster/cluster/cluster_interface.rb +550 -0
  7. data/lib/module/cluster/exception/module_not_in_stack.rb +26 -0
  8. data/lib/module/cluster/instance_controller.rb +14 -0
  9. data/lib/module/cluster/instance_controller/hook_controller.rb +33 -0
  10. data/lib/module/cluster/instance_controller/hook_controller/chain_proxy.rb +511 -0
  11. data/lib/module/cluster/instance_controller/hook_controller/hook_controller_interface.rb +830 -0
  12. data/lib/module/cluster/instance_controller/instance_controller_interface.rb +269 -0
  13. data/lib/module/cluster/instance_controller/multiple_hook_controller_proxy.rb +359 -0
  14. data/lib/module/cluster/instance_controller/multiple_hook_controller_proxy/chain_proxy.rb +442 -0
  15. data/lib/module/cluster/module_support.rb +67 -0
  16. data/lib/module/namespaces.rb +13 -0
  17. data/lib/module/requires.rb +32 -0
  18. data/spec/module/cluster/cluster_spec.rb +473 -0
  19. data/spec/module/cluster/instance_controller/hook_controller_spec.rb +922 -0
  20. data/spec/module/cluster/instance_controller/multiple_hook_controller_proxy_spec.rb +1240 -0
  21. data/spec/module/cluster_spec.rb +1794 -0
  22. metadata +27 -98
  23. data/README.rdoc +0 -395
  24. data/lib/module-cluster/ModuleCluster.rb +0 -9
  25. data/lib/module-cluster/ModuleCluster/Define.rb +0 -12
  26. data/lib/module-cluster/ModuleCluster/Define/Block.rb +0 -9
  27. data/lib/module-cluster/ModuleCluster/Define/Block/CascadingClass.rb +0 -83
  28. data/lib/module-cluster/ModuleCluster/Define/Block/CascadingClassOrModule.rb +0 -70
  29. data/lib/module-cluster/ModuleCluster/Define/Block/CascadingModule.rb +0 -79
  30. data/lib/module-cluster/ModuleCluster/Define/Block/CascadingModuleOrSubclass.rb +0 -21
  31. data/lib/module-cluster/ModuleCluster/Define/Block/Class.rb +0 -77
  32. data/lib/module-cluster/ModuleCluster/Define/Block/ClassOrInstance.rb +0 -78
  33. data/lib/module-cluster/ModuleCluster/Define/Block/ClassOrModule.rb +0 -78
  34. data/lib/module-cluster/ModuleCluster/Define/Block/ClassOrModuleOrInstance.rb +0 -78
  35. data/lib/module-cluster/ModuleCluster/Define/Block/ClassOrModuleOrSubclass.rb +0 -36
  36. data/lib/module-cluster/ModuleCluster/Define/Block/ClassOrSubclass.rb +0 -29
  37. data/lib/module-cluster/ModuleCluster/Define/Block/Instance.rb +0 -45
  38. data/lib/module-cluster/ModuleCluster/Define/Block/Module.rb +0 -77
  39. data/lib/module-cluster/ModuleCluster/Define/Block/ModuleOrInstance.rb +0 -78
  40. data/lib/module-cluster/ModuleCluster/Define/Block/ModuleOrSubclass.rb +0 -29
  41. data/lib/module-cluster/ModuleCluster/Define/Block/Subclass.rb +0 -56
  42. data/lib/module-cluster/ModuleCluster/Define/ClassCluster.rb +0 -193
  43. data/lib/module-cluster/ModuleCluster/Define/ClassOrInstanceCluster.rb +0 -128
  44. data/lib/module-cluster/ModuleCluster/Define/Cluster.rb +0 -181
  45. data/lib/module-cluster/ModuleCluster/Define/ClusterCascades.rb +0 -185
  46. data/lib/module-cluster/ModuleCluster/Define/ClusterCascadesToClass.rb +0 -181
  47. data/lib/module-cluster/ModuleCluster/Define/ClusterCascadesToModule.rb +0 -181
  48. data/lib/module-cluster/ModuleCluster/Define/Deprecated.rb +0 -40
  49. data/lib/module-cluster/ModuleCluster/Define/InstanceCluster.rb +0 -45
  50. data/lib/module-cluster/ModuleCluster/Define/ModuleCluster.rb +0 -193
  51. data/lib/module-cluster/ModuleCluster/Define/ModuleOrClassCluster.rb +0 -209
  52. data/lib/module-cluster/ModuleCluster/Define/ModuleOrInstanceCluster.rb +0 -128
  53. data/lib/module-cluster/ModuleCluster/Define/Status.rb +0 -106
  54. data/lib/module-cluster/ModuleCluster/Suspend.rb +0 -7
  55. data/lib/module-cluster/ModuleCluster/Suspend/Hooks.rb +0 -315
  56. data/lib/module-cluster/ModuleCluster/Suspend/WithoutHooks.rb +0 -153
  57. data/lib/module-cluster/_private_/ModuleCluster/CascadeFeatures.rb +0 -77
  58. data/lib/module-cluster/_private_/ModuleCluster/CascadeFeatures/ClusterStack.rb +0 -44
  59. data/lib/module-cluster/_private_/ModuleCluster/CascadeFeatures/PerformCascades.rb +0 -292
  60. data/lib/module-cluster/_private_/ModuleCluster/CascadeFeatures/Subclass.rb +0 -24
  61. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack.rb +0 -12
  62. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block.rb +0 -9
  63. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block/Class.rb +0 -36
  64. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block/Inherited.rb +0 -20
  65. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block/Instance.rb +0 -20
  66. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block/Module.rb +0 -36
  67. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block/Set.rb +0 -6
  68. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Extends.rb +0 -140
  69. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Includes.rb +0 -110
  70. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/PrependsExtends.rb +0 -140
  71. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/PrependsIncludes.rb +0 -110
  72. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Set.rb +0 -35
  73. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Set/MultiSetProxy.rb +0 -359
  74. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Status.rb +0 -55
  75. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Suspend.rb +0 -199
  76. data/lib/module-cluster/_private_/ModuleCluster/ExtendForCascade.rb +0 -34
  77. data/spec/ModuleCluster/Define/Block/CascadingClassOrModule_spec.rb +0 -285
  78. data/spec/ModuleCluster/Define/Block/CascadingClass_spec.rb +0 -254
  79. data/spec/ModuleCluster/Define/Block/CascadingModuleOrSubclass_spec.rb +0 -56
  80. data/spec/ModuleCluster/Define/Block/CascadingModule_spec.rb +0 -278
  81. data/spec/ModuleCluster/Define/Block/ClassOrInstance_spec.rb +0 -230
  82. data/spec/ModuleCluster/Define/Block/ClassOrModuleOrInstance_spec.rb +0 -238
  83. data/spec/ModuleCluster/Define/Block/ClassOrModuleOrSubclass_spec.rb +0 -54
  84. data/spec/ModuleCluster/Define/Block/ClassOrModule_spec.rb +0 -231
  85. data/spec/ModuleCluster/Define/Block/ClassOrSubclass_spec.rb +0 -54
  86. data/spec/ModuleCluster/Define/Block/Class_spec.rb +0 -224
  87. data/spec/ModuleCluster/Define/Block/Instance_spec.rb +0 -78
  88. data/spec/ModuleCluster/Define/Block/ModuleOrInstance_spec.rb +0 -54
  89. data/spec/ModuleCluster/Define/Block/ModuleOrSubclass_spec.rb +0 -51
  90. data/spec/ModuleCluster/Define/Block/Module_spec.rb +0 -230
  91. data/spec/ModuleCluster/Define/Block/Subclass_spec.rb +0 -73
  92. data/spec/ModuleCluster/Define/Block_spec.rb +0 -18
  93. data/spec/ModuleCluster/Define/ClassCluster_spec.rb +0 -728
  94. data/spec/ModuleCluster/Define/ClassOrInstanceCluster_spec.rb +0 -576
  95. data/spec/ModuleCluster/Define/ClusterCascadesToClass_spec.rb +0 -659
  96. data/spec/ModuleCluster/Define/ClusterCascadesToModule_spec.rb +0 -678
  97. data/spec/ModuleCluster/Define/ClusterCascades_spec.rb +0 -644
  98. data/spec/ModuleCluster/Define/Cluster_spec.rb +0 -708
  99. data/spec/ModuleCluster/Define/InstanceCluster_spec.rb +0 -102
  100. data/spec/ModuleCluster/Define/ModuleCluster_spec.rb +0 -728
  101. data/spec/ModuleCluster/Define/ModuleOrClassCluster_spec.rb +0 -728
  102. data/spec/ModuleCluster/Define/ModuleOrInstanceCluster_spec.rb +0 -576
  103. data/spec/ModuleCluster/Suspend/Hooks_spec.rb +0 -573
  104. data/spec/ModuleCluster/Suspend/WithoutHooks_spec.rb +0 -559
  105. data/spec/ModuleCluster_spec.rb +0 -15
  106. data/spec/_private_/ModuleCluster/CascadeFeatures/PerformCascades_spec.rb +0 -386
  107. data/spec/_private_/ModuleCluster/ClusterStack/Set/MultiSetProxy_spec.rb +0 -419
  108. data/spec/_private_/ModuleCluster/ClusterStack/Suspend_spec.rb +0 -242
@@ -1,18 +0,0 @@
1
-
2
- require_relative '../../../lib/module-cluster.rb'
3
-
4
- describe ::ModuleCluster::Define::Block do
5
-
6
- it 'is a cluster of support functions that run blocks at hooks' do
7
- module ::ModuleCluster::Define::Block
8
- ancestors.include?( ::ModuleCluster::Define::Block::Class ).should == true
9
- ancestors.include?( ::ModuleCluster::Define::Block::ClassOrInstance ).should == true
10
- ancestors.include?( ::ModuleCluster::Define::Block::ClassOrModule ).should == true
11
- ancestors.include?( ::ModuleCluster::Define::Block::ClassOrModuleOrInstance ).should == true
12
- ancestors.include?( ::ModuleCluster::Define::Block::Instance ).should == true
13
- ancestors.include?( ::ModuleCluster::Define::Block::Module ).should == true
14
- ancestors.include?( ::ModuleCluster::Define::Block::ModuleOrInstance ).should == true
15
- end
16
- end
17
-
18
- end
@@ -1,728 +0,0 @@
1
-
2
- require_relative '../../../lib/module-cluster.rb'
3
-
4
- describe ::ModuleCluster::Define::ClassCluster do
5
-
6
- ####################################
7
- # self.should_include_or_extend? #
8
- ####################################
9
-
10
- it 'should return true if class, false otherwise' do
11
- ::ModuleCluster::Define::ClassCluster.should_include_or_extend?( Kernel ).should == false
12
- ::ModuleCluster::Define::ClassCluster.should_include_or_extend?( Class ).should == true
13
- ::ModuleCluster::Define::ClassCluster.should_include_or_extend?( Object.new ).should == false
14
- end
15
-
16
- ##########################
17
- # self.should_cascade? #
18
- ##########################
19
-
20
- it 'should report false' do
21
- ::ModuleCluster::Define::ClassCluster.should_cascade?( Kernel ).should == false
22
- ::ModuleCluster::Define::ClassCluster.should_cascade?( Class ).should == false
23
- ::ModuleCluster::Define::ClassCluster.should_cascade?( Object.new ).should == false
24
- end
25
-
26
- #################################
27
- # class_include_also_includes #
28
- #################################
29
-
30
- it 'can include other modules when this one is included in a class' do
31
- module ::ModuleCluster::Define::ClassCluster::Mock01
32
- extend ::ModuleCluster::Define::ClassCluster
33
- module Module1
34
- end
35
- module Module2
36
- end
37
- class_include_also_includes( Module1, Module2 ).name = :some_name
38
- respond_to?( :included ).should == true
39
- module ModuleProof
40
- include ::ModuleCluster::Define::ClassCluster::Mock01
41
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock01::Module1 ).should == false
42
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock01::Module2 ).should == false
43
- eigenclass = class << self ; self ; end
44
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock01::Module1 ).should == false
45
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock01::Module2 ).should == false
46
- end
47
- class ClassProof
48
- include ::ModuleCluster::Define::ClassCluster::Mock01
49
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock01::Module1 ).should == true
50
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock01::Module2 ).should == true
51
- eigenclass = class << self ; self ; end
52
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock01::Module1 ).should == false
53
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock01::Module2 ).should == false
54
- end
55
- end
56
- end
57
-
58
- ################################
59
- # class_include_also_extends #
60
- ################################
61
-
62
- it 'can extend other modules when this one is included in a class' do
63
- module ::ModuleCluster::Define::ClassCluster::Mock02
64
- extend ::ModuleCluster::Define::ClassCluster
65
- module Module1
66
- end
67
- module Module2
68
- end
69
- class_include_also_extends( Module1, Module2 ).name = :some_name
70
- respond_to?( :included ).should == true
71
- module ModuleProof
72
- include ::ModuleCluster::Define::ClassCluster::Mock02
73
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock02::Module1 ).should == false
74
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock02::Module2 ).should == false
75
- eigenclass = class << self ; self ; end
76
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock02::Module1 ).should == false
77
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock02::Module2 ).should == false
78
- end
79
- class ClassProof
80
- include ::ModuleCluster::Define::ClassCluster::Mock02
81
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock02::Module1 ).should == false
82
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock02::Module2 ).should == false
83
- eigenclass = class << self ; self ; end
84
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock02::Module1 ).should == true
85
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock02::Module2 ).should == true
86
- end
87
- end
88
- end
89
-
90
- #############################################
91
- # class_include_also_includes_and_extends #
92
- #############################################
93
-
94
- it 'can include and extend other modules when this one is included in a class' do
95
- module ::ModuleCluster::Define::ClassCluster::Mock03
96
- extend ::ModuleCluster::Define::ClassCluster
97
- module Module1
98
- end
99
- module Module2
100
- end
101
- class_include_also_includes_and_extends( Module1, Module2 ).name = :some_name
102
- respond_to?( :included ).should == true
103
- module ModuleProof
104
- include ::ModuleCluster::Define::ClassCluster::Mock03
105
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock03::Module1 ).should == false
106
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock03::Module2 ).should == false
107
- eigenclass = class << self ; self ; end
108
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock03::Module1 ).should == false
109
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock03::Module2 ).should == false
110
- end
111
- class ClassProof
112
- include ::ModuleCluster::Define::ClassCluster::Mock03
113
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock03::Module1 ).should == true
114
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock03::Module2 ).should == true
115
- eigenclass = class << self ; self ; end
116
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock03::Module1 ).should == true
117
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock03::Module2 ).should == true
118
- end
119
- end
120
- end
121
-
122
- ################################
123
- # class_extend_also_includes #
124
- ################################
125
-
126
- it 'can include other modules when this one extends a class' do
127
- module ::ModuleCluster::Define::ClassCluster::Mock04
128
- extend ::ModuleCluster::Define::ClassCluster
129
- module Module1
130
- end
131
- module Module2
132
- end
133
- class_extend_also_includes( Module1, Module2 ).name = :some_name
134
- respond_to?( :extended ).should == true
135
- module ModuleProof
136
- extend ::ModuleCluster::Define::ClassCluster::Mock04
137
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock04::Module1 ).should == false
138
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock04::Module2 ).should == false
139
- eigenclass = class << self ; self ; end
140
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock04::Module1 ).should == false
141
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock04::Module2 ).should == false
142
- end
143
- class ClassProof
144
- extend ::ModuleCluster::Define::ClassCluster::Mock04
145
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock04::Module1 ).should == true
146
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock04::Module2 ).should == true
147
- eigenclass = class << self ; self ; end
148
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock04::Module1 ).should == false
149
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock04::Module2 ).should == false
150
- end
151
- end
152
- end
153
-
154
- ###############################
155
- # class_extend_also_extends #
156
- ###############################
157
-
158
- it 'can extend other modules when this one extends a class' do
159
- module ::ModuleCluster::Define::ClassCluster::Mock05
160
- extend ::ModuleCluster::Define::ClassCluster
161
- module Module1
162
- end
163
- module Module2
164
- end
165
- class_extend_also_extends( Module1, Module2 ).name = :some_name
166
- respond_to?( :extended ).should == true
167
- module ModuleProof
168
- extend ::ModuleCluster::Define::ClassCluster::Mock05
169
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock05::Module1 ).should == false
170
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock05::Module2 ).should == false
171
- eigenclass = class << self ; self ; end
172
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock05::Module1 ).should == false
173
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock05::Module2 ).should == false
174
- end
175
- class ClassProof
176
- extend ::ModuleCluster::Define::ClassCluster::Mock05
177
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock05::Module1 ).should == false
178
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock05::Module2 ).should == false
179
- eigenclass = class << self ; self ; end
180
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock05::Module1 ).should == true
181
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock05::Module2 ).should == true
182
- end
183
- Object.new.instance_eval do
184
- extend ::ModuleCluster::Define::ClassCluster::Mock05
185
- eigenclass = class << self ; self ; end
186
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock05::Module1 ).should == false
187
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock05::Module2 ).should == false
188
- end
189
- end
190
- end
191
-
192
- ############################################
193
- # class_extend_also_includes_and_extends #
194
- ############################################
195
-
196
- it 'can include and extend other modules when this one extends a class' do
197
- module ::ModuleCluster::Define::ClassCluster::Mock06
198
- extend ::ModuleCluster::Define::ClassCluster
199
- module Module1
200
- end
201
- module Module2
202
- end
203
- class_extend_also_includes_and_extends( Module1, Module2 ).name = :some_name
204
- respond_to?( :extended ).should == true
205
- module ModuleProof
206
- extend ::ModuleCluster::Define::ClassCluster::Mock06
207
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock06::Module1 ).should == false
208
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock06::Module2 ).should == false
209
- eigenclass = class << self ; self ; end
210
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock06::Module1 ).should == false
211
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock06::Module2 ).should == false
212
- end
213
- class ClassProof
214
- extend ::ModuleCluster::Define::ClassCluster::Mock06
215
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock06::Module1 ).should == true
216
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock06::Module2 ).should == true
217
- eigenclass = class << self ; self ; end
218
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock06::Module1 ).should == true
219
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock06::Module2 ).should == true
220
- end
221
- Object.new.instance_eval do
222
- extend ::ModuleCluster::Define::ClassCluster::Mock06
223
- eigenclass = class << self ; self ; end
224
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock06::Module1 ).should == false
225
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock06::Module2 ).should == false
226
- end
227
- end
228
- end
229
-
230
- #####################################
231
- # class_include_prepends_includes #
232
- #####################################
233
-
234
- it 'can include other modules before this one when this one is included in a class' do
235
- module ::ModuleCluster::Define::ClassCluster::Mock07
236
- extend ::ModuleCluster::Define::ClassCluster
237
- module Module1
238
- end
239
- module Module2
240
- end
241
- class_include_prepends_includes( Module1, Module2 ).name = :some_name
242
- respond_to?( :append_features ).should == true
243
- module ModuleProof
244
- include ::ModuleCluster::Define::ClassCluster::Mock07
245
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock07::Module1 ).should == false
246
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock07::Module2 ).should == false
247
- eigenclass = class << self ; self ; end
248
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock07::Module1 ).should == false
249
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock07::Module2 ).should == false
250
- end
251
- class ClassProof
252
- include ::ModuleCluster::Define::ClassCluster::Mock07
253
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock07::Module1 ).should == true
254
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock07::Module2 ).should == true
255
- eigenclass = class << self ; self ; end
256
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock07::Module1 ).should == false
257
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock07::Module2 ).should == false
258
- end
259
- end
260
- end
261
-
262
- ####################################
263
- # class_include_prepends_extends #
264
- ####################################
265
-
266
- it 'can extend other modules before this one when this one is included in a class' do
267
- module ::ModuleCluster::Define::ClassCluster::Mock08
268
- extend ::ModuleCluster::Define::ClassCluster
269
- module Module1
270
- end
271
- module Module2
272
- end
273
- class_include_prepends_extends( Module1, Module2 ).name = :some_name
274
- respond_to?( :append_features ).should == true
275
- module ModuleProof
276
- include ::ModuleCluster::Define::ClassCluster::Mock08
277
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock08::Module1 ).should == false
278
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock08::Module2 ).should == false
279
- eigenclass = class << self ; self ; end
280
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock08::Module1 ).should == false
281
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock08::Module2 ).should == false
282
- end
283
- class ClassProof
284
- include ::ModuleCluster::Define::ClassCluster::Mock08
285
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock08::Module1 ).should == false
286
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock08::Module2 ).should == false
287
- eigenclass = class << self ; self ; end
288
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock08::Module1 ).should == true
289
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock08::Module2 ).should == true
290
- end
291
- end
292
- end
293
-
294
- #################################################
295
- # class_include_prepends_includes_and_extends #
296
- #################################################
297
-
298
- it 'can include and extend other modules before this one when this one is included in a class' do
299
- module ::ModuleCluster::Define::ClassCluster::Mock09
300
- extend ::ModuleCluster::Define::ClassCluster
301
- module Module1
302
- end
303
- module Module2
304
- end
305
- class_include_prepends_includes_and_extends( Module1, Module2 ).name = :some_name
306
- respond_to?( :append_features ).should == true
307
- module ModuleProof
308
- include ::ModuleCluster::Define::ClassCluster::Mock09
309
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock09::Module1 ).should == false
310
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock09::Module2 ).should == false
311
- eigenclass = class << self ; self ; end
312
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock09::Module1 ).should == false
313
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock09::Module2 ).should == false
314
- end
315
- class ClassProof
316
- include ::ModuleCluster::Define::ClassCluster::Mock09
317
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock09::Module1 ).should == true
318
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock09::Module2 ).should == true
319
- eigenclass = class << self ; self ; end
320
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock09::Module1 ).should == true
321
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock09::Module2 ).should == true
322
- end
323
- end
324
- end
325
-
326
- ####################################
327
- # class_extend_prepends_includes #
328
- ####################################
329
-
330
- it 'can include other modules before this one when this one extends a class' do
331
- module ::ModuleCluster::Define::ClassCluster::Mock10
332
- extend ::ModuleCluster::Define::ClassCluster
333
- module Module1
334
- end
335
- module Module2
336
- end
337
- class_extend_prepends_includes( Module1, Module2 ).name = :some_name
338
- respond_to?( :extend_object ).should == true
339
- module ModuleProof
340
- extend ::ModuleCluster::Define::ClassCluster::Mock10
341
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock10::Module1 ).should == false
342
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock10::Module2 ).should == false
343
- eigenclass = class << self ; self ; end
344
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock10::Module1 ).should == false
345
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock10::Module2 ).should == false
346
- end
347
- class ClassProof
348
- extend ::ModuleCluster::Define::ClassCluster::Mock10
349
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock10::Module1 ).should == true
350
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock10::Module2 ).should == true
351
- eigenclass = class << self ; self ; end
352
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock10::Module1 ).should == false
353
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock10::Module2 ).should == false
354
- end
355
- end
356
- end
357
-
358
- ###################################
359
- # class_extend_prepends_extends #
360
- ###################################
361
-
362
- it 'can extend other modules before this one when this one extends a class' do
363
- module ::ModuleCluster::Define::ClassCluster::Mock11
364
- extend ::ModuleCluster::Define::ClassCluster
365
- module Module1
366
- end
367
- module Module2
368
- end
369
- class_extend_prepends_extends( Module1, Module2 ).name = :some_name
370
- respond_to?( :extend_object ).should == true
371
- module ModuleProof
372
- extend ::ModuleCluster::Define::ClassCluster::Mock11
373
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock11::Module1 ).should == false
374
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock11::Module2 ).should == false
375
- eigenclass = class << self ; self ; end
376
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock11::Module1 ).should == false
377
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock11::Module2 ).should == false
378
- end
379
- class ClassProof
380
- extend ::ModuleCluster::Define::ClassCluster::Mock11
381
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock11::Module1 ).should == false
382
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock11::Module2 ).should == false
383
- eigenclass = class << self ; self ; end
384
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock11::Module1 ).should == true
385
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock11::Module2 ).should == true
386
- end
387
- Object.new.instance_eval do
388
- extend ::ModuleCluster::Define::ClassCluster::Mock11
389
- eigenclass = class << self ; self ; end
390
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock11::Module1 ).should == false
391
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock11::Module2 ).should == false
392
- end
393
- end
394
- end
395
-
396
- ################################################
397
- # class_extend_prepends_includes_and_extends #
398
- ################################################
399
-
400
- it 'can include and extend other modules before this one when this one extends a class' do
401
- module ::ModuleCluster::Define::ClassCluster::Mock12
402
- extend ::ModuleCluster::Define::ClassCluster
403
- module Module1
404
- end
405
- module Module2
406
- end
407
- class_extend_prepends_includes_and_extends( Module1, Module2 ).name = :some_name
408
- respond_to?( :extend_object ).should == true
409
- module ModuleProof
410
- extend ::ModuleCluster::Define::ClassCluster::Mock12
411
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock12::Module1 ).should == false
412
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock12::Module2 ).should == false
413
- eigenclass = class << self ; self ; end
414
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock12::Module1 ).should == false
415
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock12::Module2 ).should == false
416
- end
417
- class ClassProof
418
- extend ::ModuleCluster::Define::ClassCluster::Mock12
419
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock12::Module1 ).should == true
420
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock12::Module2 ).should == true
421
- eigenclass = class << self ; self ; end
422
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock12::Module1 ).should == true
423
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock12::Module2 ).should == true
424
- end
425
- Object.new.instance_eval do
426
- extend ::ModuleCluster::Define::ClassCluster::Mock12
427
- eigenclass = class << self ; self ; end
428
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock12::Module1 ).should == false
429
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock12::Module2 ).should == false
430
- end
431
- end
432
- end
433
-
434
- ###########################################
435
- # class_include_or_extend_also_includes #
436
- ###########################################
437
-
438
- it 'can include other modules when this one is included in or extends a class' do
439
- module ::ModuleCluster::Define::ClassCluster::Mock13
440
- extend ::ModuleCluster::Define::ClassCluster
441
- module Module1
442
- end
443
- module Module2
444
- end
445
- class_include_or_extend_also_includes( Module1, Module2 ).name = :some_name
446
- respond_to?( :append_features ).should == true
447
- module ModuleProof
448
- include ::ModuleCluster::Define::ClassCluster::Mock13
449
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock13::Module1 ).should == false
450
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock13::Module2 ).should == false
451
- eigenclass = class << self ; self ; end
452
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock13::Module1 ).should == false
453
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock13::Module2 ).should == false
454
- end
455
- module ModuleProof2
456
- extend ::ModuleCluster::Define::ClassCluster::Mock13
457
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock13::Module1 ).should == false
458
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock13::Module2 ).should == false
459
- eigenclass = class << self ; self ; end
460
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock13::Module1 ).should == false
461
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock13::Module2 ).should == false
462
- end
463
- class ClassProof
464
- include ::ModuleCluster::Define::ClassCluster::Mock13
465
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock13::Module1 ).should == true
466
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock13::Module2 ).should == true
467
- eigenclass = class << self ; self ; end
468
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock13::Module1 ).should == false
469
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock13::Module2 ).should == false
470
- end
471
- class ClassProof2
472
- include ::ModuleCluster::Define::ClassCluster::Mock13
473
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock13::Module1 ).should == true
474
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock13::Module2 ).should == true
475
- eigenclass = class << self ; self ; end
476
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock13::Module1 ).should == false
477
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock13::Module2 ).should == false
478
- end
479
- end
480
- end
481
-
482
- ##########################################
483
- # class_include_or_extend_also_extends #
484
- ##########################################
485
-
486
- it 'can extend other modules when this one is included in or extends a class' do
487
- module ::ModuleCluster::Define::ClassCluster::Mock14
488
- extend ::ModuleCluster::Define::ClassCluster
489
- module Module1
490
- end
491
- module Module2
492
- end
493
- class_include_or_extend_also_extends( Module1, Module2 ).name = :some_name
494
- respond_to?( :included ).should == true
495
- module ModuleProof
496
- include ::ModuleCluster::Define::ClassCluster::Mock14
497
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock14::Module1 ).should == false
498
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock14::Module2 ).should == false
499
- eigenclass = class << self ; self ; end
500
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock14::Module1 ).should == false
501
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock14::Module2 ).should == false
502
- end
503
- module ModuleProof2
504
- extend ::ModuleCluster::Define::ClassCluster::Mock14
505
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock14::Module1 ).should == false
506
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock14::Module2 ).should == false
507
- eigenclass = class << self ; self ; end
508
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock14::Module1 ).should == false
509
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock14::Module2 ).should == false
510
- end
511
- class ClassProof
512
- include ::ModuleCluster::Define::ClassCluster::Mock14
513
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock14::Module1 ).should == false
514
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock14::Module2 ).should == false
515
- eigenclass = class << self ; self ; end
516
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock14::Module1 ).should == true
517
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock14::Module2 ).should == true
518
- end
519
- class ClassProof2
520
- extend ::ModuleCluster::Define::ClassCluster::Mock14
521
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock14::Module1 ).should == false
522
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock14::Module2 ).should == false
523
- eigenclass = class << self ; self ; end
524
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock14::Module1 ).should == true
525
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock14::Module2 ).should == true
526
- end
527
- end
528
- end
529
-
530
- #######################################################
531
- # class_include_or_extend_also_includes_and_extends #
532
- #######################################################
533
-
534
- it 'can include and extend other modules when this one is included in or extends a class' do
535
- module ::ModuleCluster::Define::ClassCluster::Mock15
536
- extend ::ModuleCluster::Define::ClassCluster
537
- module Module1
538
- end
539
- module Module2
540
- end
541
- class_include_or_extend_also_includes_and_extends( Module1, Module2 ).name = :some_name
542
- respond_to?( :included ).should == true
543
- module ModuleProof
544
- include ::ModuleCluster::Define::ClassCluster::Mock15
545
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock15::Module1 ).should == false
546
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock15::Module2 ).should == false
547
- eigenclass = class << self ; self ; end
548
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock15::Module1 ).should == false
549
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock15::Module2 ).should == false
550
- end
551
- module ModuleProo2
552
- extend ::ModuleCluster::Define::ClassCluster::Mock15
553
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock15::Module1 ).should == false
554
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock15::Module2 ).should == false
555
- eigenclass = class << self ; self ; end
556
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock15::Module1 ).should == false
557
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock15::Module2 ).should == false
558
- end
559
- class ClassProof
560
- include ::ModuleCluster::Define::ClassCluster::Mock15
561
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock15::Module1 ).should == true
562
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock15::Module2 ).should == true
563
- eigenclass = class << self ; self ; end
564
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock15::Module1 ).should == true
565
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock15::Module2 ).should == true
566
- end
567
- class ClassProof2
568
- extend ::ModuleCluster::Define::ClassCluster::Mock15
569
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock15::Module1 ).should == true
570
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock15::Module2 ).should == true
571
- eigenclass = class << self ; self ; end
572
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock15::Module1 ).should == true
573
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock15::Module2 ).should == true
574
- end
575
- end
576
- end
577
-
578
- ###############################################
579
- # class_include_or_extend_prepends_includes #
580
- ###############################################
581
-
582
- it 'can include other modules before this one when this one is included in or extends a class' do
583
- module ::ModuleCluster::Define::ClassCluster::Mock16
584
- extend ::ModuleCluster::Define::ClassCluster
585
- module Module1
586
- end
587
- module Module2
588
- end
589
- class_include_or_extend_prepends_includes( Module1, Module2 ).name = :some_name
590
- respond_to?( :append_features ).should == true
591
- module ModuleProof
592
- include ::ModuleCluster::Define::ClassCluster::Mock16
593
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock16::Module1 ).should == false
594
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock16::Module2 ).should == false
595
- eigenclass = class << self ; self ; end
596
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock16::Module1 ).should == false
597
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock16::Module2 ).should == false
598
- end
599
- module ModuleProof2
600
- extend ::ModuleCluster::Define::ClassCluster::Mock16
601
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock16::Module1 ).should == false
602
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock16::Module2 ).should == false
603
- eigenclass = class << self ; self ; end
604
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock16::Module1 ).should == false
605
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock16::Module2 ).should == false
606
- end
607
- class ClassProof
608
- include ::ModuleCluster::Define::ClassCluster::Mock16
609
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock16::Module1 ).should == true
610
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock16::Module2 ).should == true
611
- eigenclass = class << self ; self ; end
612
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock16::Module1 ).should == false
613
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock16::Module2 ).should == false
614
- end
615
- class ClassProof2
616
- extend ::ModuleCluster::Define::ClassCluster::Mock16
617
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock16::Module1 ).should == true
618
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock16::Module2 ).should == true
619
- eigenclass = class << self ; self ; end
620
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock16::Module1 ).should == false
621
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock16::Module2 ).should == false
622
- end
623
- end
624
- end
625
-
626
- ##############################################
627
- # class_include_or_extend_prepends_extends #
628
- ##############################################
629
-
630
- it 'can extend other modules before this one when this one is included in or extends a class' do
631
- module ::ModuleCluster::Define::ClassCluster::Mock17
632
- extend ::ModuleCluster::Define::ClassCluster
633
- module Module1
634
- end
635
- module Module2
636
- end
637
- class_include_or_extend_prepends_extends( Module1, Module2 ).name = :some_name
638
- respond_to?( :extend_object ).should == true
639
- module ModuleProof
640
- include ::ModuleCluster::Define::ClassCluster::Mock17
641
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock17::Module1 ).should == false
642
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock17::Module2 ).should == false
643
- eigenclass = class << self ; self ; end
644
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock17::Module1 ).should == false
645
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock17::Module2 ).should == false
646
- end
647
- module ModuleProof2
648
- extend ::ModuleCluster::Define::ClassCluster::Mock17
649
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock17::Module1 ).should == false
650
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock17::Module2 ).should == false
651
- eigenclass = class << self ; self ; end
652
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock17::Module1 ).should == false
653
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock17::Module2 ).should == false
654
- end
655
- class ClassProof
656
- include ::ModuleCluster::Define::ClassCluster::Mock17
657
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock17::Module1 ).should == false
658
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock17::Module2 ).should == false
659
- eigenclass = class << self ; self ; end
660
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock17::Module1 ).should == true
661
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock17::Module2 ).should == true
662
- end
663
- class ClassProof2
664
- extend ::ModuleCluster::Define::ClassCluster::Mock17
665
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock17::Module1 ).should == false
666
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock17::Module2 ).should == false
667
- eigenclass = class << self ; self ; end
668
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock17::Module1 ).should == true
669
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock17::Module2 ).should == true
670
- end
671
- Object.new.instance_eval do
672
- extend ::ModuleCluster::Define::ClassCluster::Mock17
673
- eigenclass = class << self ; self ; end
674
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock17::Module1 ).should == false
675
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock17::Module2 ).should == false
676
- end
677
- end
678
- end
679
-
680
- ###########################################################
681
- # class_include_or_extend_prepends_includes_and_extends #
682
- ###########################################################
683
-
684
- it 'can include and extend other modules before this one when this one is included in or extends a class' do
685
- module ::ModuleCluster::Define::ClassCluster::Mock18
686
- extend ::ModuleCluster::Define::ClassCluster
687
- module Module1
688
- end
689
- module Module2
690
- end
691
- class_include_or_extend_prepends_includes_and_extends( Module1, Module2 ).name = :some_name
692
- respond_to?( :append_features ).should == true
693
- module ModuleProof
694
- include ::ModuleCluster::Define::ClassCluster::Mock18
695
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock18::Module1 ).should == false
696
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock18::Module2 ).should == false
697
- eigenclass = class << self ; self ; end
698
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock18::Module1 ).should == false
699
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock18::Module2 ).should == false
700
- end
701
- module ModuleProof2
702
- extend ::ModuleCluster::Define::ClassCluster::Mock18
703
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock18::Module1 ).should == false
704
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock18::Module2 ).should == false
705
- eigenclass = class << self ; self ; end
706
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock18::Module1 ).should == false
707
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock18::Module2 ).should == false
708
- end
709
- class ClassProof
710
- include ::ModuleCluster::Define::ClassCluster::Mock18
711
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock18::Module1 ).should == true
712
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock18::Module2 ).should == true
713
- eigenclass = class << self ; self ; end
714
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock18::Module1 ).should == true
715
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock18::Module2 ).should == true
716
- end
717
- class ClassProof2
718
- extend ::ModuleCluster::Define::ClassCluster::Mock18
719
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock18::Module1 ).should == true
720
- ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock18::Module2 ).should == true
721
- eigenclass = class << self ; self ; end
722
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock18::Module1 ).should == true
723
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClassCluster::Mock18::Module2 ).should == true
724
- end
725
- end
726
- end
727
-
728
- end