module-cluster 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +17 -2
- data/README.rdoc +17 -2
- data/lib/module-cluster.rb +4 -0
- data/lib/module-cluster/ModuleCluster.rb +1 -0
- data/lib/module-cluster/ModuleCluster/Define/ModuleCluster.rb +8 -24
- data/lib/module-cluster/ModuleCluster/Define/ModuleClusterCascades.rb +8 -24
- data/lib/module-cluster/ModuleCluster/Define/ModuleClusterCascadesToClass.rb +8 -24
- data/lib/module-cluster/ModuleCluster/Define/ModuleClusterCascadesToModule.rb +124 -0
- data/lib/module-cluster/ModuleCluster/Define/_private_/ModuleClusterCascadesToModule.rb +126 -0
- data/spec/ModuleCluster/Define/ModuleClusterCascadesToModule_spec.rb +432 -0
- data/spec/ModuleCluster/Define/_private_/ModuleClusterCascadesToModule_spec.rb +266 -0
- data/spec/ModuleCluster_spec.rb +1 -0
- metadata +7 -3
@@ -0,0 +1,266 @@
|
|
1
|
+
|
2
|
+
require_relative '../../../../lib/module-cluster.rb'
|
3
|
+
|
4
|
+
describe ModuleCluster::Define::ModuleClusterCascadesToModule do
|
5
|
+
|
6
|
+
########################################################
|
7
|
+
# anonymous_module_cascade_to_module_append_features #
|
8
|
+
########################################################
|
9
|
+
|
10
|
+
it 'it can construct an anonymous module each time requested to append features with modules' do
|
11
|
+
class ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock01
|
12
|
+
extend ModuleCluster::Define::ModuleClusterCascadesToModule
|
13
|
+
module Module1
|
14
|
+
end
|
15
|
+
module Module2
|
16
|
+
end
|
17
|
+
anonymous_module_cascade_to_module_append_features_instance = anonymous_module_cascade_to_module_append_features( :include, Module1, Module2 )
|
18
|
+
anonymous_module_cascade_to_module_append_features_instance.is_a?( Module ).should == true
|
19
|
+
anonymous_module_cascade_to_module_append_features_instance.instance_methods.include?( :append_features ).should == true
|
20
|
+
module SomeModule
|
21
|
+
end
|
22
|
+
SomeModule.extend( anonymous_module_cascade_to_module_append_features_instance )
|
23
|
+
SomeModule.respond_to?( :append_features ).should == true
|
24
|
+
module SomeOtherModule
|
25
|
+
include ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock01::SomeModule
|
26
|
+
ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock01::Module1 ).should == true
|
27
|
+
ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock01::Module2 ).should == true
|
28
|
+
( ancestors.index( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock01::Module1 ) > ancestors.index( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock01::Module2 ) ).should == true
|
29
|
+
( ancestors.index( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock01::Module2 ) > ancestors.index( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock01::SomeModule ) ).should == true
|
30
|
+
( ancestors.index( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock01::SomeModule ) > ancestors.index( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock01::SomeOtherModule ) ).should == true
|
31
|
+
end
|
32
|
+
module Cascade1
|
33
|
+
include ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock01::SomeOtherModule
|
34
|
+
ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock01::Module1 ).should == true
|
35
|
+
ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock01::Module2 ).should == true
|
36
|
+
( ancestors.index( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock01::Module1 ) > ancestors.index( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock01::Module2 ) ).should == true
|
37
|
+
( ancestors.index( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock01::Module2 ) > ancestors.index( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock01::SomeModule ) ).should == true
|
38
|
+
( ancestors.index( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock01::SomeModule ) > ancestors.index( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock01::SomeOtherModule ) ).should == true
|
39
|
+
end
|
40
|
+
class CascadeClass1
|
41
|
+
include ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock01::Cascade1
|
42
|
+
# true because of ancestor chain
|
43
|
+
ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock01::Module1 ).should == true
|
44
|
+
ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock01::Module2 ).should == true
|
45
|
+
end
|
46
|
+
anonymous_module_cascade_to_module_append_features_instance2 = anonymous_module_cascade_to_module_append_features( :extend, Module1, Module2 )
|
47
|
+
anonymous_module_cascade_to_module_append_features_instance2.should_not == anonymous_module_cascade_to_module_append_features_instance
|
48
|
+
module AnotherModule
|
49
|
+
end
|
50
|
+
AnotherModule.extend( anonymous_module_cascade_to_module_append_features_instance2 )
|
51
|
+
AnotherModule.respond_to?( :append_features ).should == true
|
52
|
+
module YetAnotherModule
|
53
|
+
include ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock01::AnotherModule
|
54
|
+
eigenclass = class << self ; self ; end
|
55
|
+
eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock01::Module1 ).should == true
|
56
|
+
eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock01::Module2 ).should == true
|
57
|
+
( eigenclass.ancestors.index( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock01::Module1 ) > eigenclass.ancestors.index( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock01::Module2 ) ).should == true
|
58
|
+
end
|
59
|
+
module Cascade2
|
60
|
+
include ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock01::YetAnotherModule
|
61
|
+
eigenclass = class << self ; self ; end
|
62
|
+
eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock01::Module1 ).should == true
|
63
|
+
eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock01::Module2 ).should == true
|
64
|
+
( eigenclass.ancestors.index( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock01::Module1 ) > eigenclass.ancestors.index( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock01::Module2 ) ).should == true
|
65
|
+
end
|
66
|
+
class CascadeClass2
|
67
|
+
include ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock01::Cascade2
|
68
|
+
eigenclass = class << self ; self ; end
|
69
|
+
eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock01::Module1 ).should == false
|
70
|
+
eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock01::Module2 ).should == false
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
#################################################
|
76
|
+
# anonymous_module_cascade_to_module_included #
|
77
|
+
#################################################
|
78
|
+
|
79
|
+
it 'it can construct an anonymous module each time requested to include with modules' do
|
80
|
+
class ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock02
|
81
|
+
extend ModuleCluster::Define::ModuleClusterCascadesToModule
|
82
|
+
module Module1
|
83
|
+
end
|
84
|
+
module Module2
|
85
|
+
end
|
86
|
+
anonymous_module_cascade_to_module_included_instance = anonymous_module_cascade_to_module_included( :include, Module1, Module2 )
|
87
|
+
anonymous_module_cascade_to_module_included_instance.is_a?( Module ).should == true
|
88
|
+
anonymous_module_cascade_to_module_included_instance.instance_methods.include?( :included ).should == true
|
89
|
+
module SomeModule
|
90
|
+
end
|
91
|
+
SomeModule.extend( anonymous_module_cascade_to_module_included_instance )
|
92
|
+
SomeModule.respond_to?( :included ).should == true
|
93
|
+
module SomeOtherModule
|
94
|
+
include ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock02::SomeModule
|
95
|
+
ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock02::Module1 ).should == true
|
96
|
+
ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock02::Module2 ).should == true
|
97
|
+
end
|
98
|
+
module Cascade1
|
99
|
+
include ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock02::SomeOtherModule
|
100
|
+
ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock02::Module1 ).should == true
|
101
|
+
ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock02::Module2 ).should == true
|
102
|
+
end
|
103
|
+
class CascadeClass1
|
104
|
+
include ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock02::Cascade1
|
105
|
+
# true because of ancestor chain
|
106
|
+
ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock02::Module1 ).should == true
|
107
|
+
ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock02::Module2 ).should == true
|
108
|
+
end
|
109
|
+
anonymous_module_cascade_to_module_included_instance2 = anonymous_module_cascade_to_module_included( :extend, Module1, Module2 )
|
110
|
+
anonymous_module_cascade_to_module_included_instance2.should_not == anonymous_module_cascade_to_module_included_instance
|
111
|
+
module AnotherModule
|
112
|
+
end
|
113
|
+
AnotherModule.extend( anonymous_module_cascade_to_module_included_instance2 )
|
114
|
+
AnotherModule.respond_to?( :included ).should == true
|
115
|
+
module YetAnotherModule
|
116
|
+
include ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock02::AnotherModule
|
117
|
+
eigenclass = class << self ; self ; end
|
118
|
+
eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock02::Module1 ).should == true
|
119
|
+
eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock02::Module2 ).should == true
|
120
|
+
( eigenclass.ancestors.index( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock02::Module1 ) > eigenclass.ancestors.index( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock02::Module2 ) ).should == true
|
121
|
+
end
|
122
|
+
module Cascade2
|
123
|
+
include ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock02::YetAnotherModule
|
124
|
+
eigenclass = class << self ; self ; end
|
125
|
+
eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock02::Module1 ).should == true
|
126
|
+
eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock02::Module2 ).should == true
|
127
|
+
( eigenclass.ancestors.index( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock02::Module1 ) > eigenclass.ancestors.index( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock02::Module2 ) ).should == true
|
128
|
+
end
|
129
|
+
class CascadeClass2
|
130
|
+
include ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock02::Cascade2
|
131
|
+
eigenclass = class << self ; self ; end
|
132
|
+
eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock02::Module1 ).should == false
|
133
|
+
eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock02::Module2 ).should == false
|
134
|
+
end
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
######################################################
|
139
|
+
# anonymous_module_cascade_to_module_extend_object #
|
140
|
+
######################################################
|
141
|
+
|
142
|
+
it 'it can construct an anonymous module each time requested to extend object with modules' do
|
143
|
+
class ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock03
|
144
|
+
extend ModuleCluster::Define::ModuleClusterCascadesToModule
|
145
|
+
module Module1
|
146
|
+
end
|
147
|
+
module Module2
|
148
|
+
end
|
149
|
+
anonymous_module_cascade_to_module_extend_object_instance = anonymous_module_cascade_to_module_extend_object( :include, Module1, Module2 )
|
150
|
+
anonymous_module_cascade_to_module_extend_object_instance.is_a?( Module ).should == true
|
151
|
+
anonymous_module_cascade_to_module_extend_object_instance.instance_methods.include?( :extend_object ).should == true
|
152
|
+
module SomeModule
|
153
|
+
end
|
154
|
+
SomeModule.extend( anonymous_module_cascade_to_module_extend_object_instance )
|
155
|
+
SomeModule.respond_to?( :extend_object ).should == true
|
156
|
+
module SomeOtherModule
|
157
|
+
extend ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock03::SomeModule
|
158
|
+
ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock03::Module1 ).should == true
|
159
|
+
ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock03::Module2 ).should == true
|
160
|
+
( ancestors.index( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock03::Module1 ) > ancestors.index( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock03::Module2 ) ).should == true
|
161
|
+
end
|
162
|
+
module Cascade1
|
163
|
+
extend ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock03::SomeOtherModule
|
164
|
+
ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock03::Module1 ).should == true
|
165
|
+
ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock03::Module2 ).should == true
|
166
|
+
( ancestors.index( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock03::Module1 ) > ancestors.index( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock03::Module2 ) ).should == true
|
167
|
+
end
|
168
|
+
class CascadeClass1
|
169
|
+
extend ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock03::Cascade1
|
170
|
+
ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock03::Module1 ).should == false
|
171
|
+
ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock03::Module2 ).should == false
|
172
|
+
end
|
173
|
+
anonymous_module_cascade_to_module_extend_object_instance2 = anonymous_module_cascade_to_module_extend_object( :extend, Module1, Module2 )
|
174
|
+
anonymous_module_cascade_to_module_extend_object_instance2.should_not == anonymous_module_cascade_to_module_extend_object_instance
|
175
|
+
module AnotherModule
|
176
|
+
end
|
177
|
+
AnotherModule.extend( anonymous_module_cascade_to_module_extend_object_instance2 )
|
178
|
+
AnotherModule.respond_to?( :extend_object ).should == true
|
179
|
+
module YetAnotherModule
|
180
|
+
extend ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock03::AnotherModule
|
181
|
+
eigenclass = class << self ; self ; end
|
182
|
+
eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock03::Module1 ).should == true
|
183
|
+
eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock03::Module2 ).should == true
|
184
|
+
( eigenclass.ancestors.index( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock03::Module1 ) > eigenclass.ancestors.index( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock03::Module2 ) ).should == true
|
185
|
+
end
|
186
|
+
module Cascade2
|
187
|
+
extend ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock03::YetAnotherModule
|
188
|
+
eigenclass = class << self ; self ; end
|
189
|
+
eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock03::Module1 ).should == true
|
190
|
+
eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock03::Module2 ).should == true
|
191
|
+
( eigenclass.ancestors.index( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock03::Module1 ) > eigenclass.ancestors.index( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock03::Module2 ) ).should == true
|
192
|
+
end
|
193
|
+
class CascadeClass2
|
194
|
+
extend ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock03::Cascade2
|
195
|
+
eigenclass = class << self ; self ; end
|
196
|
+
eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock03::Module1 ).should == false
|
197
|
+
eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock03::Module2 ).should == false
|
198
|
+
end
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
202
|
+
#################################################
|
203
|
+
# anonymous_module_cascade_to_module_extended #
|
204
|
+
#################################################
|
205
|
+
|
206
|
+
it 'it can construct an anonymous module each time requested to extend with modules' do
|
207
|
+
class ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock04
|
208
|
+
extend ModuleCluster::Define::ModuleClusterCascadesToModule
|
209
|
+
module Module1
|
210
|
+
end
|
211
|
+
module Module2
|
212
|
+
end
|
213
|
+
anonymous_module_cascade_to_module_extended_instance = anonymous_module_cascade_to_module_extended( :include, Module1, Module2 )
|
214
|
+
anonymous_module_cascade_to_module_extended_instance.is_a?( Module ).should == true
|
215
|
+
anonymous_module_cascade_to_module_extended_instance.instance_methods.include?( :extended ).should == true
|
216
|
+
module SomeModule
|
217
|
+
end
|
218
|
+
SomeModule.extend( anonymous_module_cascade_to_module_extended_instance )
|
219
|
+
SomeModule.respond_to?( :extended ).should == true
|
220
|
+
module SomeOtherModule
|
221
|
+
extend ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock04::SomeModule
|
222
|
+
ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock04::Module1 ).should == true
|
223
|
+
ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock04::Module2 ).should == true
|
224
|
+
( ancestors.index( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock04::Module1 ) > ancestors.index( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock04::Module2 ) ).should == true
|
225
|
+
end
|
226
|
+
module Cascade1
|
227
|
+
extend ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock04::SomeOtherModule
|
228
|
+
ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock04::Module1 ).should == true
|
229
|
+
ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock04::Module2 ).should == true
|
230
|
+
( ancestors.index( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock04::Module1 ) > ancestors.index( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock04::Module2 ) ).should == true
|
231
|
+
end
|
232
|
+
class CascadeClass1
|
233
|
+
extend ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock04::Cascade1
|
234
|
+
ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock04::Module1 ).should == false
|
235
|
+
ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock04::Module2 ).should == false
|
236
|
+
end
|
237
|
+
anonymous_module_cascade_to_module_extended_instance2 = anonymous_module_cascade_to_module_extended( :extend, Module1, Module2 )
|
238
|
+
anonymous_module_cascade_to_module_extended_instance2.should_not == anonymous_module_cascade_to_module_extended_instance
|
239
|
+
module AnotherModule
|
240
|
+
end
|
241
|
+
AnotherModule.extend( anonymous_module_cascade_to_module_extended_instance2 )
|
242
|
+
AnotherModule.respond_to?( :extended ).should == true
|
243
|
+
module YetAnotherModule
|
244
|
+
extend ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock04::AnotherModule
|
245
|
+
eigenclass = class << self ; self ; end
|
246
|
+
eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock04::Module1 ).should == true
|
247
|
+
eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock04::Module2 ).should == true
|
248
|
+
( eigenclass.ancestors.index( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock04::Module1 ) > eigenclass.ancestors.index( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock04::Module2 ) ).should == true
|
249
|
+
end
|
250
|
+
module Cascade2
|
251
|
+
extend ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock04::YetAnotherModule
|
252
|
+
eigenclass = class << self ; self ; end
|
253
|
+
eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock04::Module1 ).should == true
|
254
|
+
eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock04::Module2 ).should == true
|
255
|
+
( eigenclass.ancestors.index( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock04::Module1 ) > eigenclass.ancestors.index( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock04::Module2 ) ).should == true
|
256
|
+
end
|
257
|
+
class CascadeClass2
|
258
|
+
extend ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock04::Cascade2
|
259
|
+
eigenclass = class << self ; self ; end
|
260
|
+
eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock04::Module1 ).should == false
|
261
|
+
eigenclass.ancestors.include?( ModuleCluster::Define::ModuleClusterCascadesToModule::PrivateMock04::Module2 ).should == false
|
262
|
+
end
|
263
|
+
end
|
264
|
+
end
|
265
|
+
|
266
|
+
end
|
data/spec/ModuleCluster_spec.rb
CHANGED
@@ -7,6 +7,7 @@ describe ModuleCluster do
|
|
7
7
|
is_a?( ModuleCluster::Define::ModuleCluster )
|
8
8
|
is_a?( ModuleCluster::Define::ModuleClusterCascades )
|
9
9
|
is_a?( ModuleCluster::Define::ModuleClusterCascadesToClass )
|
10
|
+
is_a?( ModuleCluster::Define::ModuleClusterCascadesToModule )
|
10
11
|
is_a?( ModuleCluster::Define::Deprecated )
|
11
12
|
end
|
12
13
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 1.2.
|
8
|
+
- 2
|
9
|
+
version: 1.2.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Asher
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-
|
17
|
+
date: 2011-08-01 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|
@@ -31,19 +31,23 @@ files:
|
|
31
31
|
- lib/module-cluster/ModuleCluster/Define/_private_/ModuleCluster.rb
|
32
32
|
- lib/module-cluster/ModuleCluster/Define/_private_/ModuleClusterCascades.rb
|
33
33
|
- lib/module-cluster/ModuleCluster/Define/_private_/ModuleClusterCascadesToClass.rb
|
34
|
+
- lib/module-cluster/ModuleCluster/Define/_private_/ModuleClusterCascadesToModule.rb
|
34
35
|
- lib/module-cluster/ModuleCluster/Define/Deprecated.rb
|
35
36
|
- lib/module-cluster/ModuleCluster/Define/ModuleCluster.rb
|
36
37
|
- lib/module-cluster/ModuleCluster/Define/ModuleClusterCascades.rb
|
37
38
|
- lib/module-cluster/ModuleCluster/Define/ModuleClusterCascadesToClass.rb
|
39
|
+
- lib/module-cluster/ModuleCluster/Define/ModuleClusterCascadesToModule.rb
|
38
40
|
- lib/module-cluster/ModuleCluster.rb
|
39
41
|
- lib/module-cluster.rb
|
40
42
|
- spec/ModuleCluster/Define/_private_/ClusterStack_spec.rb
|
41
43
|
- spec/ModuleCluster/Define/_private_/ModuleCluster_spec.rb
|
42
44
|
- spec/ModuleCluster/Define/_private_/ModuleClusterCascades_spec.rb
|
43
45
|
- spec/ModuleCluster/Define/_private_/ModuleClusterCascadesToClass_spec.rb
|
46
|
+
- spec/ModuleCluster/Define/_private_/ModuleClusterCascadesToModule_spec.rb
|
44
47
|
- spec/ModuleCluster/Define/ModuleCluster_spec.rb
|
45
48
|
- spec/ModuleCluster/Define/ModuleClusterCascades_spec.rb
|
46
49
|
- spec/ModuleCluster/Define/ModuleClusterCascadesToClass_spec.rb
|
50
|
+
- spec/ModuleCluster/Define/ModuleClusterCascadesToModule_spec.rb
|
47
51
|
- spec/ModuleCluster_spec.rb
|
48
52
|
- README.md
|
49
53
|
- README.rdoc
|