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,678 +0,0 @@
1
-
2
- require_relative '../../../lib/module-cluster.rb'
3
-
4
- describe ::ModuleCluster::Define::ClusterCascadesToModule do
5
-
6
- ##########################
7
- # self.should_cascade? #
8
- ##########################
9
-
10
- it 'should cascade to modules' do
11
- ::ModuleCluster::Define::ClusterCascadesToModule.should_cascade?( Kernel ).should == true
12
- ::ModuleCluster::Define::ClusterCascadesToModule.should_cascade?( Class ).should == false
13
- ::ModuleCluster::Define::ClusterCascadesToModule.should_cascade?( Object.new ).should == false
14
- end
15
-
16
- #########################################
17
- # include_cascades_includes_to_module #
18
- #########################################
19
-
20
- it 'include modules for any class this module or any including modules are included in' do
21
- module ::ModuleCluster::Define::ClusterCascadesToModule::Mock01
22
- extend ::ModuleCluster::Define::ClusterCascadesToModule
23
- module Module1
24
- end
25
- module Module2
26
- end
27
- include_cascades_includes_to_module( Module1, Module2 ).name = :some_name
28
- respond_to?( :included ).should == true
29
- module ModuleProof1
30
- include ::ModuleCluster::Define::ClusterCascadesToModule::Mock01
31
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock01::Module1 ).should == true
32
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock01::Module2 ).should == true
33
- eigenclass = class << self ; self ; end
34
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock01::Module1 ).should == false
35
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock01::Module2 ).should == false
36
- end
37
- class ClassProof
38
- include ::ModuleCluster::Define::ClusterCascadesToModule::Mock01
39
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock01::Module1 ).should == false
40
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock01::Module2 ).should == false
41
- eigenclass = class << self ; self ; end
42
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock01::Module1 ).should == false
43
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock01::Module2 ).should == false
44
- end
45
- module ModuleProof2
46
- include ::ModuleCluster::Define::ClusterCascadesToModule::Mock01::ModuleProof1
47
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock01::Module1 ).should == true
48
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock01::Module2 ).should == true
49
- eigenclass = class << self ; self ; end
50
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock01::Module1 ).should == false
51
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock01::Module2 ).should == false
52
- end
53
- class ClassProof2
54
- include ::ModuleCluster::Define::ClusterCascadesToModule::Mock01::ModuleProof1
55
- # true b/c of ancestor chain
56
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock01::Module1 ).should == true
57
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock01::Module2 ).should == true
58
- eigenclass = class << self ; self ; end
59
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock01::Module1 ).should == false
60
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock01::Module2 ).should == false
61
- end
62
- end
63
- end
64
-
65
- ########################################
66
- # include_cascades_extends_to_module #
67
- ########################################
68
-
69
- it 'extends modules for any class this module or any including modules are included in' do
70
- module ::ModuleCluster::Define::ClusterCascadesToModule::Mock02
71
- extend ::ModuleCluster::Define::ClusterCascadesToModule
72
- module Module1
73
- end
74
- module Module2
75
- end
76
- include_cascades_extends_to_module( Module1, Module2 ).name = :some_name
77
- respond_to?( :included ).should == true
78
- module ModuleProof1
79
- include ::ModuleCluster::Define::ClusterCascadesToModule::Mock02
80
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock02::Module1 ).should == false
81
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock02::Module2 ).should == false
82
- eigenclass = class << self ; self ; end
83
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock02::Module1 ).should == true
84
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock02::Module2 ).should == true
85
- end
86
- class ClassProof
87
- include ::ModuleCluster::Define::ClusterCascadesToModule::Mock02
88
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock02::Module1 ).should == false
89
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock02::Module2 ).should == false
90
- eigenclass = class << self ; self ; end
91
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock02::Module1 ).should == false
92
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock02::Module2 ).should == false
93
- end
94
- module ModuleProof2
95
- include ::ModuleCluster::Define::ClusterCascadesToModule::Mock02::ModuleProof1
96
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock02::Module1 ).should == false
97
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock02::Module2 ).should == false
98
- eigenclass = class << self ; self ; end
99
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock02::Module1 ).should == true
100
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock02::Module2 ).should == true
101
- end
102
- class ClassProof2
103
- include ::ModuleCluster::Define::ClusterCascadesToModule::Mock02::ModuleProof1
104
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock02::Module1 ).should == false
105
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock02::Module2 ).should == false
106
- eigenclass = class << self ; self ; end
107
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock02::Module1 ).should == false
108
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock02::Module2 ).should == false
109
- end
110
- end
111
- end
112
-
113
- #####################################################
114
- # include_cascades_includes_and_extends_to_module #
115
- #####################################################
116
-
117
- it 'include and extends modules for any class this module or any including modules are included in' do
118
- module ::ModuleCluster::Define::ClusterCascadesToModule::Mock03
119
- extend ::ModuleCluster::Define::ClusterCascadesToModule
120
- module Module1
121
- end
122
- module Module2
123
- end
124
- include_cascades_includes_and_extends_to_module( Module1, Module2 ).name = :some_name
125
- respond_to?( :included ).should == true
126
- module ModuleProof1
127
- include ::ModuleCluster::Define::ClusterCascadesToModule::Mock03
128
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock03::Module1 ).should == true
129
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock03::Module2 ).should == true
130
- eigenclass = class << self ; self ; end
131
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock03::Module1 ).should == true
132
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock03::Module2 ).should == true
133
- end
134
- class ClassProof
135
- include ::ModuleCluster::Define::ClusterCascadesToModule::Mock03
136
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock03::Module1 ).should == false
137
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock03::Module2 ).should == false
138
- eigenclass = class << self ; self ; end
139
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock03::Module1 ).should == false
140
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock03::Module2 ).should == false
141
- end
142
- module ModuleProof2
143
- include ::ModuleCluster::Define::ClusterCascadesToModule::Mock03::ModuleProof1
144
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock03::Module1 ).should == true
145
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock03::Module2 ).should == true
146
- eigenclass = class << self ; self ; end
147
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock03::Module1 ).should == true
148
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock03::Module2 ).should == true
149
- end
150
- class ClassProof2
151
- include ::ModuleCluster::Define::ClusterCascadesToModule::Mock03::ModuleProof1
152
- # true b/c of ancestor chain
153
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock03::Module1 ).should == true
154
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock03::Module2 ).should == true
155
- eigenclass = class << self ; self ; end
156
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock03::Module1 ).should == false
157
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock03::Module2 ).should == false
158
- end
159
- end
160
- end
161
-
162
- ########################################
163
- # extend_cascades_includes_to_module #
164
- ########################################
165
-
166
- it 'include modules for any class this module is extended in' do
167
- module ::ModuleCluster::Define::ClusterCascadesToModule::Mock04
168
- extend ::ModuleCluster::Define::ClusterCascadesToModule
169
- module Module1
170
- end
171
- module Module2
172
- end
173
- extend_cascades_includes_to_module( Module1, Module2 ).name = :some_name
174
- respond_to?( :extended ).should == true
175
- module ModuleProof1
176
- extend ::ModuleCluster::Define::ClusterCascadesToModule::Mock04
177
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock04::Module1 ).should == true
178
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock04::Module2 ).should == true
179
- eigenclass = class << self ; self ; end
180
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock04::Module1 ).should == false
181
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock04::Module2 ).should == false
182
- end
183
- class ClassProof
184
- extend ::ModuleCluster::Define::ClusterCascadesToModule::Mock04
185
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock04::Module1 ).should == false
186
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock04::Module2 ).should == false
187
- eigenclass = class << self ; self ; end
188
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock04::Module1 ).should == false
189
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock04::Module2 ).should == false
190
- end
191
- Object.new.instance_eval do
192
- extend ::ModuleCluster::Define::ClusterCascadesToModule::Mock04
193
- eigenclass = class << self ; self ; end
194
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock04::Module1 ).should == false
195
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock04::Module2 ).should == false
196
- end
197
- module ModuleProof2
198
- extend ::ModuleCluster::Define::ClusterCascadesToModule::Mock04::ModuleProof1
199
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock04::Module1 ).should == true
200
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock04::Module2 ).should == true
201
- eigenclass = class << self ; self ; end
202
- # true because of ancestor chain
203
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock04::Module1 ).should == true
204
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock04::Module2 ).should == true
205
- end
206
- class ClassProof2
207
- extend ::ModuleCluster::Define::ClusterCascadesToModule::Mock04::ModuleProof1
208
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock04::Module1 ).should == false
209
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock04::Module2 ).should == false
210
- eigenclass = class << self ; self ; end
211
- # true because of ancestor chain
212
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock04::Module1 ).should == true
213
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock04::Module2 ).should == true
214
- end
215
- Object.new.instance_eval do
216
- extend ::ModuleCluster::Define::ClusterCascadesToModule::Mock04::ModuleProof1
217
- eigenclass = class << self ; self ; end
218
- # true because of ancestor chain
219
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock04::Module1 ).should == true
220
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock04::Module2 ).should == true
221
- end
222
- end
223
- end
224
-
225
- #######################################
226
- # extend_cascades_extends_to_module #
227
- #######################################
228
-
229
- it 'extend modules for any class this module is extended in' do
230
- module ::ModuleCluster::Define::ClusterCascadesToModule::Mock05
231
- extend ::ModuleCluster::Define::ClusterCascadesToModule
232
- module Module1
233
- end
234
- module Module2
235
- end
236
- extend_cascades_extends_to_module( Module1, Module2 ).name = :some_name
237
- respond_to?( :extended ).should == true
238
- module ModuleProof1
239
- extend ::ModuleCluster::Define::ClusterCascadesToModule::Mock05
240
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock05::Module1 ).should == false
241
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock05::Module2 ).should == false
242
- eigenclass = class << self ; self ; end
243
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock05::Module1 ).should == true
244
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock05::Module2 ).should == true
245
- end
246
- class ClassProof
247
- extend ::ModuleCluster::Define::ClusterCascadesToModule::Mock05
248
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock05::Module1 ).should == false
249
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock05::Module2 ).should == false
250
- eigenclass = class << self ; self ; end
251
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock05::Module1 ).should == false
252
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock05::Module2 ).should == false
253
- end
254
- Object.new.instance_eval do
255
- extend ::ModuleCluster::Define::ClusterCascadesToModule::Mock05
256
- eigenclass = class << self ; self ; end
257
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock05::Module1 ).should == false
258
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock05::Module2 ).should == false
259
- end
260
- module ModuleProof2
261
- extend ::ModuleCluster::Define::ClusterCascadesToModule::Mock05::ModuleProof1
262
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock05::Module1 ).should == false
263
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock05::Module2 ).should == false
264
- eigenclass = class << self ; self ; end
265
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock05::Module1 ).should == true
266
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock05::Module2 ).should == true
267
- end
268
- class ClassProof2
269
- extend ::ModuleCluster::Define::ClusterCascadesToModule::Mock05::ModuleProof1
270
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock05::Module1 ).should == false
271
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock05::Module2 ).should == false
272
- eigenclass = class << self ; self ; end
273
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock05::Module1 ).should == false
274
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock05::Module2 ).should == false
275
- end
276
- Object.new.instance_eval do
277
- extend ::ModuleCluster::Define::ClusterCascadesToModule::Mock05::ModuleProof1
278
- eigenclass = class << self ; self ; end
279
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock05::Module1 ).should == false
280
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock05::Module2 ).should == false
281
- end
282
- end
283
- end
284
-
285
- ####################################################
286
- # extend_cascades_includes_and_extends_to_module #
287
- ####################################################
288
-
289
- it 'include and extend modules for any class this module is extended in' do
290
- module ::ModuleCluster::Define::ClusterCascadesToModule::Mock06
291
- extend ::ModuleCluster::Define::ClusterCascadesToModule
292
- module Module1
293
- end
294
- module Module2
295
- end
296
- extend_cascades_includes_and_extends_to_module( Module1, Module2 ).name = :some_name
297
- respond_to?( :extended ).should == true
298
- module ModuleProof1
299
- extend ::ModuleCluster::Define::ClusterCascadesToModule::Mock06
300
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock06::Module1 ).should == true
301
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock06::Module2 ).should == true
302
- eigenclass = class << self ; self ; end
303
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock06::Module1 ).should == true
304
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock06::Module2 ).should == true
305
- end
306
- class ClassProof
307
- extend ::ModuleCluster::Define::ClusterCascadesToModule::Mock06
308
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock06::Module1 ).should == false
309
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock06::Module2 ).should == false
310
- eigenclass = class << self ; self ; end
311
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock06::Module1 ).should == false
312
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock06::Module2 ).should == false
313
- end
314
- Object.new.instance_eval do
315
- extend ::ModuleCluster::Define::ClusterCascadesToModule::Mock06
316
- eigenclass = class << self ; self ; end
317
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock06::Module1 ).should == false
318
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock06::Module2 ).should == false
319
- end
320
- module ModuleProof2
321
- extend ::ModuleCluster::Define::ClusterCascadesToModule::Mock06::ModuleProof1
322
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock06::Module1 ).should == true
323
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock06::Module2 ).should == true
324
- eigenclass = class << self ; self ; end
325
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock06::Module1 ).should == true
326
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock06::Module2 ).should == true
327
- end
328
- class ClassProof2
329
- extend ::ModuleCluster::Define::ClusterCascadesToModule::Mock06::ModuleProof1
330
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock06::Module1 ).should == false
331
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock06::Module2 ).should == false
332
- eigenclass = class << self ; self ; end
333
- # true because Proof2's ancestor chain includes
334
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock06::Module1 ).should == true
335
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock06::Module2 ).should == true
336
- end
337
- Object.new.instance_eval do
338
- extend ::ModuleCluster::Define::ClusterCascadesToModule::Mock06::ModuleProof1
339
- eigenclass = class << self ; self ; end
340
- # true because Proof2's ancestor chain includes
341
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock06::Module1 ).should == true
342
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock06::Module2 ).should == true
343
- end
344
- end
345
- end
346
-
347
- ####################################################
348
- # include_cascades_to_module_prepend_includes #
349
- ####################################################
350
-
351
- 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
352
- module ::ModuleCluster::Define::ClusterCascadesToModule::Mock07
353
- extend ::ModuleCluster::Define::ClusterCascadesToModule
354
- module Module1
355
- end
356
- module Module2
357
- end
358
- include_cascades_to_module_prepend_includes( Module1, Module2 ).name = :some_name
359
- respond_to?( :append_features ).should == true
360
- module ModuleProof1
361
- include ::ModuleCluster::Define::ClusterCascadesToModule::Mock07
362
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock07::Module1 ).should == true
363
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock07::Module2 ).should == true
364
- eigenclass = class << self ; self ; end
365
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock07::Module1 ).should == false
366
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock07::Module2 ).should == false
367
- end
368
- class ClassProof
369
- include ::ModuleCluster::Define::ClusterCascadesToModule::Mock07
370
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock07::Module1 ).should == false
371
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock07::Module2 ).should == false
372
- eigenclass = class << self ; self ; end
373
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock07::Module1 ).should == false
374
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock07::Module2 ).should == false
375
- end
376
- module ModuleProof2
377
- include ::ModuleCluster::Define::ClusterCascadesToModule::Mock07::ModuleProof1
378
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock07::Module1 ).should == true
379
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock07::Module2 ).should == true
380
- eigenclass = class << self ; self ; end
381
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock07::Module1 ).should == false
382
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock07::Module2 ).should == false
383
- end
384
- class ClassProof2
385
- include ::ModuleCluster::Define::ClusterCascadesToModule::Mock07::ModuleProof1
386
- # true b/c of ancestor chain
387
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock07::Module1 ).should == true
388
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock07::Module2 ).should == true
389
- eigenclass = class << self ; self ; end
390
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock07::Module1 ).should == false
391
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock07::Module2 ).should == false
392
- end
393
- end
394
- end
395
-
396
- ###################################################
397
- # include_cascades_to_module_prepend_extends #
398
- ###################################################
399
-
400
- 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
401
- module ::ModuleCluster::Define::ClusterCascadesToModule::Mock08
402
- extend ::ModuleCluster::Define::ClusterCascadesToModule
403
- module Module1
404
- end
405
- module Module2
406
- end
407
- include_cascades_to_module_prepend_extends( Module1, Module2 ).name = :some_name
408
- respond_to?( :append_features ).should == true
409
- module ModuleProof1
410
- include ::ModuleCluster::Define::ClusterCascadesToModule::Mock08
411
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock08::Module1 ).should == false
412
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock08::Module2 ).should == false
413
- eigenclass = class << self ; self ; end
414
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock08::Module1 ).should == true
415
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock08::Module2 ).should == true
416
- end
417
- class ClassProof
418
- include ::ModuleCluster::Define::ClusterCascadesToModule::Mock08
419
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock08::Module1 ).should == false
420
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock08::Module2 ).should == false
421
- eigenclass = class << self ; self ; end
422
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock08::Module1 ).should == false
423
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock08::Module2 ).should == false
424
- end
425
- module ModuleProof2
426
- include ::ModuleCluster::Define::ClusterCascadesToModule::Mock08::ModuleProof1
427
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock08::Module1 ).should == false
428
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock08::Module2 ).should == false
429
- eigenclass = class << self ; self ; end
430
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock08::Module1 ).should == true
431
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock08::Module2 ).should == true
432
- end
433
- class ClassProof2
434
- include ::ModuleCluster::Define::ClusterCascadesToModule::Mock08::ModuleProof1
435
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock08::Module1 ).should == false
436
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock08::Module2 ).should == false
437
- eigenclass = class << self ; self ; end
438
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock08::Module1 ).should == false
439
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock08::Module2 ).should == false
440
- end
441
- end
442
- end
443
-
444
- ################################################################
445
- # include_cascades_to_module_prepend_includes_and_extends #
446
- ################################################################
447
-
448
- 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
449
- module ::ModuleCluster::Define::ClusterCascadesToModule::Mock09
450
- extend ::ModuleCluster::Define::ClusterCascadesToModule
451
- module Module1
452
- end
453
- module Module2
454
- end
455
- include_cascades_to_module_prepend_includes_and_extends( Module1, Module2 ).name = :some_name
456
- respond_to?( :append_features ).should == true
457
- module ModuleProof1
458
- include ::ModuleCluster::Define::ClusterCascadesToModule::Mock09
459
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock09::Module1 ).should == true
460
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock09::Module2 ).should == true
461
- eigenclass = class << self ; self ; end
462
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock09::Module1 ).should == true
463
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock09::Module2 ).should == true
464
- end
465
- class ClassProof
466
- include ::ModuleCluster::Define::ClusterCascadesToModule::Mock09
467
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock09::Module1 ).should == false
468
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock09::Module2 ).should == false
469
- eigenclass = class << self ; self ; end
470
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock09::Module1 ).should == false
471
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock09::Module2 ).should == false
472
- end
473
- module ModuleProof2
474
- include ::ModuleCluster::Define::ClusterCascadesToModule::Mock09::ModuleProof1
475
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock09::Module1 ).should == true
476
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock09::Module2 ).should == true
477
- eigenclass = class << self ; self ; end
478
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock09::Module1 ).should == true
479
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock09::Module2 ).should == true
480
- end
481
- class ClassProof2
482
- include ::ModuleCluster::Define::ClusterCascadesToModule::Mock09::ModuleProof1
483
- # true b/c of ancestor chain
484
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock09::Module1 ).should == true
485
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock09::Module2 ).should == true
486
- eigenclass = class << self ; self ; end
487
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock09::Module1 ).should == false
488
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock09::Module2 ).should == false
489
- end
490
- end
491
- end
492
-
493
- ###################################################
494
- # extend_cascades_to_module_prepend_includes #
495
- ###################################################
496
-
497
- it 'include other modules for any class this module or any including modules are included in, before this module is extended' do
498
- module ::ModuleCluster::Define::ClusterCascadesToModule::Mock10
499
- extend ::ModuleCluster::Define::ClusterCascadesToModule
500
- module Module1
501
- end
502
- module Module2
503
- end
504
- extend_cascades_to_module_prepend_includes( Module1, Module2 ).name = :some_name
505
- respond_to?( :extend_object ).should == true
506
- module ModuleProof1
507
- extend ::ModuleCluster::Define::ClusterCascadesToModule::Mock10
508
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock10::Module1 ).should == true
509
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock10::Module2 ).should == true
510
- eigenclass = class << self ; self ; end
511
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock10::Module1 ).should == false
512
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock10::Module2 ).should == false
513
- end
514
- class ClassProof
515
- extend ::ModuleCluster::Define::ClusterCascadesToModule::Mock10
516
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock10::Module1 ).should == false
517
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock10::Module2 ).should == false
518
- eigenclass = class << self ; self ; end
519
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock10::Module1 ).should == false
520
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock10::Module2 ).should == false
521
- end
522
- Object.new.instance_eval do
523
- extend ::ModuleCluster::Define::ClusterCascadesToModule::Mock10
524
- eigenclass = class << self ; self ; end
525
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock10::Module1 ).should == false
526
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock10::Module2 ).should == false
527
- end
528
- module ModuleProof2
529
- extend ::ModuleCluster::Define::ClusterCascadesToModule::Mock10::ModuleProof1
530
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock10::Module1 ).should == true
531
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock10::Module2 ).should == true
532
- eigenclass = class << self ; self ; end
533
- # true because of ancestor chain
534
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock10::Module1 ).should == true
535
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock10::Module2 ).should == true
536
- end
537
- class ClassProof2
538
- extend ::ModuleCluster::Define::ClusterCascadesToModule::Mock10::ModuleProof1
539
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock10::Module1 ).should == false
540
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock10::Module2 ).should == false
541
- eigenclass = class << self ; self ; end
542
- # true because of ancestor chain
543
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock10::Module1 ).should == true
544
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock10::Module2 ).should == true
545
- end
546
- Object.new.instance_eval do
547
- extend ::ModuleCluster::Define::ClusterCascadesToModule::Mock10::ModuleProof1
548
- eigenclass = class << self ; self ; end
549
- # true because of ancestor chain
550
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock10::Module1 ).should == true
551
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock10::Module2 ).should == true
552
- end
553
- end
554
- end
555
-
556
- ##################################################
557
- # extend_cascades_to_module_prepend_extends #
558
- ##################################################
559
-
560
- it 'extend other modules for any class this module or any including modules are included in, before this module is extended' do
561
- module ::ModuleCluster::Define::ClusterCascadesToModule::Mock11
562
- extend ::ModuleCluster::Define::ClusterCascadesToModule
563
- module Module1
564
- end
565
- module Module2
566
- end
567
- extend_cascades_to_module_prepend_extends( Module1, Module2 ).name = :some_name
568
- respond_to?( :extend_object ).should == true
569
- module ModuleProof1
570
- extend ::ModuleCluster::Define::ClusterCascadesToModule::Mock11
571
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock11::Module1 ).should == false
572
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock11::Module2 ).should == false
573
- eigenclass = class << self ; self ; end
574
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock11::Module1 ).should == true
575
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock11::Module2 ).should == true
576
- end
577
- class ClassProof
578
- extend ::ModuleCluster::Define::ClusterCascadesToModule::Mock11
579
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock11::Module1 ).should == false
580
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock11::Module2 ).should == false
581
- eigenclass = class << self ; self ; end
582
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock11::Module1 ).should == false
583
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock11::Module2 ).should == false
584
- end
585
- Object.new.instance_eval do
586
- extend ::ModuleCluster::Define::ClusterCascadesToModule::Mock11
587
- eigenclass = class << self ; self ; end
588
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock11::Module1 ).should == false
589
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock11::Module2 ).should == false
590
- end
591
- module ModuleProof2
592
- extend ::ModuleCluster::Define::ClusterCascadesToModule::Mock11::ModuleProof1
593
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock11::Module1 ).should == false
594
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock11::Module2 ).should == false
595
- eigenclass = class << self ; self ; end
596
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock11::Module1 ).should == true
597
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock11::Module2 ).should == true
598
- end
599
- class ClassProof2
600
- extend ::ModuleCluster::Define::ClusterCascadesToModule::Mock11::ModuleProof1
601
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock11::Module1 ).should == false
602
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock11::Module2 ).should == false
603
- eigenclass = class << self ; self ; end
604
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock11::Module1 ).should == false
605
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock11::Module2 ).should == false
606
- end
607
- Object.new.instance_eval do
608
- extend ::ModuleCluster::Define::ClusterCascadesToModule::Mock11::ModuleProof1
609
- eigenclass = class << self ; self ; end
610
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock11::Module1 ).should == false
611
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock11::Module2 ).should == false
612
- end
613
- end
614
- end
615
-
616
- ###############################################################
617
- # extend_cascades_to_module_prepend_includes_and_extends #
618
- ###############################################################
619
-
620
- it 'include and extend other modules for any class this module or any including modules are included in, before this module is extended' do
621
- module ::ModuleCluster::Define::ClusterCascadesToModule::Mock12
622
- extend ::ModuleCluster::Define::ClusterCascadesToModule
623
- module Module1
624
- end
625
- module Module2
626
- end
627
- extend_cascades_to_module_prepend_includes_and_extends( Module1, Module2 ).name = :some_name
628
- respond_to?( :extend_object ).should == true
629
- module ModuleProof1
630
- extend ::ModuleCluster::Define::ClusterCascadesToModule::Mock12
631
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock12::Module1 ).should == true
632
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock12::Module2 ).should == true
633
- eigenclass = class << self ; self ; end
634
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock12::Module1 ).should == true
635
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock12::Module2 ).should == true
636
- end
637
- class ClassProof
638
- extend ::ModuleCluster::Define::ClusterCascadesToModule::Mock12
639
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock12::Module1 ).should == false
640
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock12::Module2 ).should == false
641
- eigenclass = class << self ; self ; end
642
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock12::Module1 ).should == false
643
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock12::Module2 ).should == false
644
- end
645
- Object.new.instance_eval do
646
- extend ::ModuleCluster::Define::ClusterCascadesToModule::Mock12
647
- eigenclass = class << self ; self ; end
648
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock12::Module1 ).should == false
649
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock12::Module2 ).should == false
650
- end
651
- module ModuleProof2
652
- extend ::ModuleCluster::Define::ClusterCascadesToModule::Mock12::ModuleProof1
653
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock12::Module1 ).should == true
654
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock12::Module2 ).should == true
655
- eigenclass = class << self ; self ; end
656
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock12::Module1 ).should == true
657
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock12::Module2 ).should == true
658
- end
659
- class ClassProof2
660
- extend ::ModuleCluster::Define::ClusterCascadesToModule::Mock12::ModuleProof1
661
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock12::Module1 ).should == false
662
- ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock12::Module2 ).should == false
663
- eigenclass = class << self ; self ; end
664
- # true because of ancestor chain
665
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock12::Module1 ).should == true
666
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock12::Module2 ).should == true
667
- end
668
- Object.new.instance_eval do
669
- extend ::ModuleCluster::Define::ClusterCascadesToModule::Mock12::ModuleProof1
670
- eigenclass = class << self ; self ; end
671
- # true because of ancestor chain
672
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock12::Module1 ).should == true
673
- eigenclass.ancestors.include?( ::ModuleCluster::Define::ClusterCascadesToModule::Mock12::Module2 ).should == true
674
- end
675
- end
676
- end
677
-
678
- end