module-cluster 1.4.4 → 1.4.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +21 -0
- data/README.rdoc +21 -0
- data/lib/module-cluster/ModuleCluster/Define/Block/CascadingClass.rb +83 -0
- data/lib/module-cluster/ModuleCluster/Define/Block/CascadingClassOrModule.rb +70 -0
- data/lib/module-cluster/ModuleCluster/Define/Block/CascadingModule.rb +79 -0
- data/lib/module-cluster/ModuleCluster/Define/Block/CascadingModuleOrSubclass.rb +22 -0
- data/lib/module-cluster/ModuleCluster/Define/Block/Class.rb +15 -7
- data/lib/module-cluster/ModuleCluster/Define/Block/ClassOrInstance.rb +15 -7
- data/lib/module-cluster/ModuleCluster/Define/Block/ClassOrModule.rb +15 -7
- data/lib/module-cluster/ModuleCluster/Define/Block/ClassOrModuleOrInstance.rb +15 -7
- data/lib/module-cluster/ModuleCluster/Define/Block/ClassOrModuleOrSubclass.rb +11 -3
- data/lib/module-cluster/ModuleCluster/Define/Block/ClassOrSubclass.rb +10 -2
- data/lib/module-cluster/ModuleCluster/Define/Block/Instance.rb +15 -3
- data/lib/module-cluster/ModuleCluster/Define/Block/Module.rb +15 -7
- data/lib/module-cluster/ModuleCluster/Define/Block/ModuleOrInstance.rb +15 -7
- data/lib/module-cluster/ModuleCluster/Define/Block/ModuleOrSubclass.rb +10 -2
- data/lib/module-cluster/ModuleCluster/Define/Block/Subclass.rb +13 -2
- data/lib/module-cluster/ModuleCluster/Define/Block.rb +1 -1
- data/lib/module-cluster/ModuleCluster/Define/ClassCluster.rb +19 -19
- data/lib/module-cluster/ModuleCluster/Define/ClassOrInstanceCluster.rb +34 -34
- data/lib/module-cluster/ModuleCluster/Define/Cluster.rb +19 -19
- data/lib/module-cluster/ModuleCluster/Define/ClusterCascades.rb +19 -19
- data/lib/module-cluster/ModuleCluster/Define/ClusterCascadesToClass.rb +19 -19
- data/lib/module-cluster/ModuleCluster/Define/ClusterCascadesToModule.rb +19 -19
- data/lib/module-cluster/ModuleCluster/Define/Deprecated.rb +1 -1
- data/lib/module-cluster/ModuleCluster/Define/InstanceCluster.rb +3 -3
- data/lib/module-cluster/ModuleCluster/Define/ModuleCluster.rb +19 -19
- data/lib/module-cluster/ModuleCluster/Define/ModuleOrClassCluster.rb +43 -43
- data/lib/module-cluster/ModuleCluster/Define/ModuleOrInstanceCluster.rb +34 -34
- data/lib/module-cluster/ModuleCluster/Define/Status.rb +1 -1
- data/lib/module-cluster/ModuleCluster/Define.rb +1 -1
- data/lib/module-cluster/ModuleCluster/Suspend/Hooks.rb +1 -1
- data/lib/module-cluster/ModuleCluster/Suspend/WithoutHooks.rb +1 -1
- data/lib/module-cluster/ModuleCluster/Suspend.rb +1 -1
- data/lib/module-cluster/ModuleCluster.rb +1 -1
- data/lib/module-cluster/_private_/ModuleCluster/CascadeFeatures/ClusterStack.rb +3 -3
- data/lib/module-cluster/_private_/ModuleCluster/CascadeFeatures/PerformCascades.rb +85 -32
- data/lib/module-cluster/_private_/ModuleCluster/CascadeFeatures/Subclass.rb +6 -3
- data/lib/module-cluster/_private_/ModuleCluster/CascadeFeatures.rb +5 -5
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block/Class.rb +9 -9
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block/Inherited.rb +3 -3
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block/Instance.rb +5 -5
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block/Module.rb +9 -9
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block/Set.rb +1 -0
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block.rb +1 -1
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Extends.rb +13 -13
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Includes.rb +10 -10
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/PrependsExtends.rb +13 -13
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/PrependsIncludes.rb +10 -10
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Set/MultiSetProxy.rb +1 -1
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Status.rb +1 -1
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Suspend.rb +1 -1
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack.rb +1 -1
- data/lib/module-cluster/_private_/ModuleCluster/ExtendForCascade/Subclass.rb +1 -1
- data/lib/module-cluster/_private_/ModuleCluster/ExtendForCascade.rb +1 -1
- data/lib/module-cluster.rb +14 -2
- data/spec/ModuleCluster/Define/Block/CascadingClassOrModule_spec.rb +285 -0
- data/spec/ModuleCluster/Define/Block/CascadingClass_spec.rb +241 -0
- data/spec/ModuleCluster/Define/Block/CascadingModuleOrSubclass_spec.rb +56 -0
- data/spec/ModuleCluster/Define/Block/CascadingModule_spec.rb +278 -0
- data/spec/ModuleCluster/Define/Block/ClassOrInstance_spec.rb +13 -13
- data/spec/ModuleCluster/Define/Block/ClassOrModuleOrInstance_spec.rb +13 -13
- data/spec/ModuleCluster/Define/Block/ClassOrModuleOrSubclass_spec.rb +2 -3
- data/spec/ModuleCluster/Define/Block/ClassOrModule_spec.rb +13 -13
- data/spec/ModuleCluster/Define/Block/ClassOrSubclass_spec.rb +2 -2
- data/spec/ModuleCluster/Define/Block/Class_spec.rb +13 -13
- data/spec/ModuleCluster/Define/Block/Instance_spec.rb +5 -5
- data/spec/ModuleCluster/Define/Block/ModuleOrInstance_spec.rb +1 -1
- data/spec/ModuleCluster/Define/Block/ModuleOrSubclass_spec.rb +2 -4
- data/spec/ModuleCluster/Define/Block/Module_spec.rb +13 -13
- data/spec/ModuleCluster/Define/Block/Subclass_spec.rb +8 -8
- data/spec/ModuleCluster/Define/Block_spec.rb +9 -9
- data/spec/ModuleCluster/Define/ClassCluster_spec.rb +227 -227
- data/spec/ModuleCluster/Define/ClassOrInstanceCluster_spec.rb +197 -197
- data/spec/ModuleCluster/Define/ClusterCascadesToClass_spec.rb +228 -228
- data/spec/ModuleCluster/Define/ClusterCascadesToModule_spec.rb +232 -232
- data/spec/ModuleCluster/Define/ClusterCascades_spec.rb +224 -224
- data/spec/ModuleCluster/Define/Cluster_spec.rb +221 -221
- data/spec/ModuleCluster/Define/InstanceCluster_spec.rb +29 -29
- data/spec/ModuleCluster/Define/ModuleCluster_spec.rb +227 -227
- data/spec/ModuleCluster/Define/ModuleOrClassCluster_spec.rb +227 -227
- data/spec/ModuleCluster/Define/ModuleOrInstanceCluster_spec.rb +197 -197
- data/spec/ModuleCluster/Suspend/Hooks_spec.rb +120 -120
- data/spec/ModuleCluster/Suspend/WithoutHooks_spec.rb +120 -120
- data/spec/ModuleCluster_spec.rb +2 -2
- data/spec/_private_/ModuleCluster/CascadeFeatures/PerformCascades_spec.rb +192 -192
- data/spec/_private_/ModuleCluster/ClusterStack/Set/MultiSetProxy_spec.rb +129 -129
- data/spec/_private_/ModuleCluster/ClusterStack/Suspend_spec.rb +17 -17
- metadata +9 -1
@@ -1,19 +1,19 @@
|
|
1
1
|
|
2
2
|
require_relative '../../../../lib/module-cluster.rb'
|
3
3
|
|
4
|
-
describe ModuleCluster::Define::Block::ClassOrModuleOrInstance do
|
4
|
+
describe ::ModuleCluster::Define::Block::ClassOrModuleOrInstance do
|
5
5
|
|
6
6
|
########################################
|
7
7
|
# class_or_module_or_instance_extend #
|
8
8
|
########################################
|
9
9
|
|
10
10
|
it 'can run a block on class or module extend' do
|
11
|
-
module ModuleCluster::Define::Block::ClassOrModuleOrInstance::Mock01
|
11
|
+
module ::ModuleCluster::Define::Block::ClassOrModuleOrInstance::Mock01
|
12
12
|
extend ::ModuleCluster::Define::Block::ClassOrModuleOrInstance
|
13
13
|
block_ran = false
|
14
14
|
class_or_module_or_instance_extend do
|
15
15
|
block_ran = true
|
16
|
-
self.should == ModuleCluster::Define::Block::ClassOrModuleOrInstance::Mock01
|
16
|
+
self.should == ::ModuleCluster::Define::Block::ClassOrModuleOrInstance::Mock01
|
17
17
|
end
|
18
18
|
respond_to?( :extended ).should == true
|
19
19
|
module ModuleProof
|
@@ -46,12 +46,12 @@ describe ModuleCluster::Define::Block::ClassOrModuleOrInstance do
|
|
46
46
|
################################################
|
47
47
|
|
48
48
|
it 'can run a block on class or module include or instance extend' do
|
49
|
-
module ModuleCluster::Define::Block::ClassOrModuleOrInstance::Mock02
|
49
|
+
module ::ModuleCluster::Define::Block::ClassOrModuleOrInstance::Mock02
|
50
50
|
extend ::ModuleCluster::Define::Block::ClassOrModuleOrInstance
|
51
51
|
block_ran = false
|
52
52
|
class_or_module_include_or_instance_extend do
|
53
53
|
block_ran = true
|
54
|
-
self.should == ModuleCluster::Define::Block::ClassOrModuleOrInstance::Mock02
|
54
|
+
self.should == ::ModuleCluster::Define::Block::ClassOrModuleOrInstance::Mock02
|
55
55
|
end
|
56
56
|
respond_to?( :extended ).should == true
|
57
57
|
module ModuleProof
|
@@ -84,12 +84,12 @@ describe ModuleCluster::Define::Block::ClassOrModuleOrInstance do
|
|
84
84
|
##########################################################
|
85
85
|
|
86
86
|
it 'can run a block on class or module include or extend or instance extend' do
|
87
|
-
module ModuleCluster::Define::Block::ClassOrModuleOrInstance::Mock03
|
87
|
+
module ::ModuleCluster::Define::Block::ClassOrModuleOrInstance::Mock03
|
88
88
|
extend ::ModuleCluster::Define::Block::ClassOrModuleOrInstance
|
89
89
|
block_ran = false
|
90
90
|
class_or_module_include_or_extend_or_instance_extend do
|
91
91
|
block_ran = true
|
92
|
-
self.should == ModuleCluster::Define::Block::ClassOrModuleOrInstance::Mock03
|
92
|
+
self.should == ::ModuleCluster::Define::Block::ClassOrModuleOrInstance::Mock03
|
93
93
|
end
|
94
94
|
respond_to?( :extended ).should == true
|
95
95
|
module ModuleProof
|
@@ -124,12 +124,12 @@ describe ModuleCluster::Define::Block::ClassOrModuleOrInstance do
|
|
124
124
|
################################################
|
125
125
|
|
126
126
|
it 'can run a block before class or module extend' do
|
127
|
-
module ModuleCluster::Define::Block::ClassOrModuleOrInstance::Mock04
|
127
|
+
module ::ModuleCluster::Define::Block::ClassOrModuleOrInstance::Mock04
|
128
128
|
extend ::ModuleCluster::Define::Block::ClassOrModuleOrInstance
|
129
129
|
block_ran = false
|
130
130
|
prepend_class_or_module_or_instance_extend do
|
131
131
|
block_ran = true
|
132
|
-
self.should == ModuleCluster::Define::Block::ClassOrModuleOrInstance::Mock04
|
132
|
+
self.should == ::ModuleCluster::Define::Block::ClassOrModuleOrInstance::Mock04
|
133
133
|
end
|
134
134
|
respond_to?( :extended ).should == true
|
135
135
|
module ModuleProof
|
@@ -162,12 +162,12 @@ describe ModuleCluster::Define::Block::ClassOrModuleOrInstance do
|
|
162
162
|
########################################################
|
163
163
|
|
164
164
|
it 'can run a block before class or module include or instance extend' do
|
165
|
-
module ModuleCluster::Define::Block::ClassOrModuleOrInstance::Mock05
|
165
|
+
module ::ModuleCluster::Define::Block::ClassOrModuleOrInstance::Mock05
|
166
166
|
extend ::ModuleCluster::Define::Block::ClassOrModuleOrInstance
|
167
167
|
block_ran = false
|
168
168
|
prepend_class_or_module_include_or_instance_extend do
|
169
169
|
block_ran = true
|
170
|
-
self.should == ModuleCluster::Define::Block::ClassOrModuleOrInstance::Mock05
|
170
|
+
self.should == ::ModuleCluster::Define::Block::ClassOrModuleOrInstance::Mock05
|
171
171
|
end
|
172
172
|
respond_to?( :extended ).should == true
|
173
173
|
module ModuleProof
|
@@ -200,12 +200,12 @@ describe ModuleCluster::Define::Block::ClassOrModuleOrInstance do
|
|
200
200
|
##################################################################
|
201
201
|
|
202
202
|
it 'can run a block before class or module include or extend or instance extend' do
|
203
|
-
module ModuleCluster::Define::Block::ClassOrModuleOrInstance::Mock06
|
203
|
+
module ::ModuleCluster::Define::Block::ClassOrModuleOrInstance::Mock06
|
204
204
|
extend ::ModuleCluster::Define::Block::ClassOrModuleOrInstance
|
205
205
|
block_ran = false
|
206
206
|
prepend_class_or_module_include_or_extend_or_instance_extend do
|
207
207
|
block_ran = true
|
208
|
-
self.should == ModuleCluster::Define::Block::ClassOrModuleOrInstance::Mock06
|
208
|
+
self.should == ::ModuleCluster::Define::Block::ClassOrModuleOrInstance::Mock06
|
209
209
|
end
|
210
210
|
respond_to?( :extended ).should == true
|
211
211
|
module ModuleProof
|
@@ -1,19 +1,18 @@
|
|
1
1
|
|
2
2
|
require_relative '../../../../lib/module-cluster.rb'
|
3
3
|
|
4
|
-
describe ModuleCluster::Define::Block::ClassOrModuleOrSubclass do
|
4
|
+
describe ::ModuleCluster::Define::Block::ClassOrModuleOrSubclass do
|
5
5
|
|
6
6
|
########################################
|
7
7
|
# class_or_module_or_instance_extend #
|
8
8
|
########################################
|
9
9
|
|
10
10
|
it 'can run a block on class or module extend' do
|
11
|
-
module ModuleCluster::Define::Block::ClassOrModuleOrSubclass::Mock01
|
11
|
+
module ::ModuleCluster::Define::Block::ClassOrModuleOrSubclass::Mock01
|
12
12
|
extend ::ModuleCluster::Define::Block::ClassOrModuleOrSubclass
|
13
13
|
block_ran = false
|
14
14
|
class_or_module_include_or_subclass do
|
15
15
|
block_ran = true
|
16
|
-
self.should == ModuleCluster::Define::Block::ClassOrModuleOrSubclass::Mock01
|
17
16
|
end
|
18
17
|
respond_to?( :extended ).should == true
|
19
18
|
module ModuleProof
|
@@ -1,19 +1,19 @@
|
|
1
1
|
|
2
2
|
require_relative '../../../../lib/module-cluster.rb'
|
3
3
|
|
4
|
-
describe ModuleCluster::Define::Block::ClassOrModule do
|
4
|
+
describe ::ModuleCluster::Define::Block::ClassOrModule do
|
5
5
|
|
6
6
|
#############################
|
7
7
|
# class_or_module_include #
|
8
8
|
#############################
|
9
9
|
|
10
10
|
it 'can run a block on class or module include' do
|
11
|
-
module ModuleCluster::Define::Block::ClassOrModule::Mock01
|
11
|
+
module ::ModuleCluster::Define::Block::ClassOrModule::Mock01
|
12
12
|
extend ::ModuleCluster::Define::Block::ClassOrModule
|
13
13
|
block_ran = false
|
14
14
|
class_or_module_include do
|
15
15
|
block_ran = true
|
16
|
-
self.should == ModuleCluster::Define::Block::ClassOrModule::Mock01
|
16
|
+
self.should == ::ModuleCluster::Define::Block::ClassOrModule::Mock01
|
17
17
|
end
|
18
18
|
respond_to?( :included ).should == true
|
19
19
|
class ClassProof
|
@@ -45,12 +45,12 @@ describe ModuleCluster::Define::Block::ClassOrModule do
|
|
45
45
|
############################
|
46
46
|
|
47
47
|
it 'can run a block on class or module extend' do
|
48
|
-
module ModuleCluster::Define::Block::ClassOrModule::Mock02
|
48
|
+
module ::ModuleCluster::Define::Block::ClassOrModule::Mock02
|
49
49
|
extend ::ModuleCluster::Define::Block::ClassOrModule
|
50
50
|
block_ran = false
|
51
51
|
class_or_module_extend do
|
52
52
|
block_ran = true
|
53
|
-
self.should == ModuleCluster::Define::Block::ClassOrModule::Mock02
|
53
|
+
self.should == ::ModuleCluster::Define::Block::ClassOrModule::Mock02
|
54
54
|
end
|
55
55
|
respond_to?( :extended ).should == true
|
56
56
|
class ClassProof
|
@@ -81,12 +81,12 @@ describe ModuleCluster::Define::Block::ClassOrModule do
|
|
81
81
|
#######################################
|
82
82
|
|
83
83
|
it 'can run a block on class or module include or extend' do
|
84
|
-
module ModuleCluster::Define::Block::ClassOrModule::Mock03
|
84
|
+
module ::ModuleCluster::Define::Block::ClassOrModule::Mock03
|
85
85
|
extend ::ModuleCluster::Define::Block::ClassOrModule
|
86
86
|
block_ran = false
|
87
87
|
class_or_module_include_or_extend do
|
88
88
|
block_ran = true
|
89
|
-
self.should == ModuleCluster::Define::Block::ClassOrModule::Mock03
|
89
|
+
self.should == ::ModuleCluster::Define::Block::ClassOrModule::Mock03
|
90
90
|
end
|
91
91
|
respond_to?( :extended ).should == true
|
92
92
|
class ClassProof
|
@@ -120,12 +120,12 @@ describe ModuleCluster::Define::Block::ClassOrModule do
|
|
120
120
|
#####################################
|
121
121
|
|
122
122
|
it 'can run a block before class or module include' do
|
123
|
-
module ModuleCluster::Define::Block::ClassOrModule::Mock04
|
123
|
+
module ::ModuleCluster::Define::Block::ClassOrModule::Mock04
|
124
124
|
extend ::ModuleCluster::Define::Block::ClassOrModule
|
125
125
|
block_ran = false
|
126
126
|
prepend_class_or_module_include do
|
127
127
|
block_ran = true
|
128
|
-
self.should == ModuleCluster::Define::Block::ClassOrModule::Mock04
|
128
|
+
self.should == ::ModuleCluster::Define::Block::ClassOrModule::Mock04
|
129
129
|
end
|
130
130
|
respond_to?( :included ).should == true
|
131
131
|
class ClassProof
|
@@ -157,12 +157,12 @@ describe ModuleCluster::Define::Block::ClassOrModule do
|
|
157
157
|
####################################
|
158
158
|
|
159
159
|
it 'can run a block before class or module extend' do
|
160
|
-
module ModuleCluster::Define::Block::ClassOrModule::Mock05
|
160
|
+
module ::ModuleCluster::Define::Block::ClassOrModule::Mock05
|
161
161
|
extend ::ModuleCluster::Define::Block::ClassOrModule
|
162
162
|
block_ran = false
|
163
163
|
prepend_class_or_module_extend do
|
164
164
|
block_ran = true
|
165
|
-
self.should == ModuleCluster::Define::Block::ClassOrModule::Mock05
|
165
|
+
self.should == ::ModuleCluster::Define::Block::ClassOrModule::Mock05
|
166
166
|
end
|
167
167
|
respond_to?( :extended ).should == true
|
168
168
|
class ClassProof
|
@@ -194,12 +194,12 @@ describe ModuleCluster::Define::Block::ClassOrModule do
|
|
194
194
|
###############################################
|
195
195
|
|
196
196
|
it 'can run a block before class or module include or extend' do
|
197
|
-
module ModuleCluster::Define::Block::ClassOrModule::Mock06
|
197
|
+
module ::ModuleCluster::Define::Block::ClassOrModule::Mock06
|
198
198
|
extend ::ModuleCluster::Define::Block::ClassOrModule
|
199
199
|
block_ran = false
|
200
200
|
prepend_class_or_module_include_or_extend do
|
201
201
|
block_ran = true
|
202
|
-
self.should == ModuleCluster::Define::Block::ClassOrModule::Mock06
|
202
|
+
self.should == ::ModuleCluster::Define::Block::ClassOrModule::Mock06
|
203
203
|
end
|
204
204
|
respond_to?( :extended ).should == true
|
205
205
|
class ClassProof
|
@@ -1,14 +1,14 @@
|
|
1
1
|
|
2
2
|
require_relative '../../../../lib/module-cluster.rb'
|
3
3
|
|
4
|
-
describe ModuleCluster::Define::Block::ClassOrSubclass do
|
4
|
+
describe ::ModuleCluster::Define::Block::ClassOrSubclass do
|
5
5
|
|
6
6
|
###############################
|
7
7
|
# class_include_or_subclass #
|
8
8
|
###############################
|
9
9
|
|
10
10
|
it 'can run a block on class or module extend' do
|
11
|
-
module ModuleCluster::Define::Block::ClassOrSubclass::Mock01
|
11
|
+
module ::ModuleCluster::Define::Block::ClassOrSubclass::Mock01
|
12
12
|
extend ::ModuleCluster::Define::Block::ClassOrSubclass
|
13
13
|
block_ran = false
|
14
14
|
class_include_or_subclass do |class_instance|
|
@@ -1,19 +1,19 @@
|
|
1
1
|
|
2
2
|
require_relative '../../../../lib/module-cluster.rb'
|
3
3
|
|
4
|
-
describe ModuleCluster::Define::Block::Class do
|
4
|
+
describe ::ModuleCluster::Define::Block::Class do
|
5
5
|
|
6
6
|
###################
|
7
7
|
# class_include #
|
8
8
|
###################
|
9
9
|
|
10
10
|
it 'can run a block on class include' do
|
11
|
-
module ModuleCluster::Define::Block::Class::Mock01
|
11
|
+
module ::ModuleCluster::Define::Block::Class::Mock01
|
12
12
|
extend ::ModuleCluster::Define::Block::Class
|
13
13
|
block_ran = false
|
14
14
|
class_include do
|
15
15
|
block_ran = true
|
16
|
-
self.should == ModuleCluster::Define::Block::Class::Mock01
|
16
|
+
self.should == ::ModuleCluster::Define::Block::Class::Mock01
|
17
17
|
end
|
18
18
|
respond_to?( :included ).should == true
|
19
19
|
module ModuleProof
|
@@ -44,12 +44,12 @@ describe ModuleCluster::Define::Block::Class do
|
|
44
44
|
##################
|
45
45
|
|
46
46
|
it 'can run a block on class extend' do
|
47
|
-
module ModuleCluster::Define::Block::Class::Mock02
|
47
|
+
module ::ModuleCluster::Define::Block::Class::Mock02
|
48
48
|
extend ::ModuleCluster::Define::Block::Class
|
49
49
|
block_ran = false
|
50
50
|
class_extend do
|
51
51
|
block_ran = true
|
52
|
-
self.should == ModuleCluster::Define::Block::Class::Mock02
|
52
|
+
self.should == ::ModuleCluster::Define::Block::Class::Mock02
|
53
53
|
end
|
54
54
|
respond_to?( :extended ).should == true
|
55
55
|
module ModuleProof
|
@@ -80,12 +80,12 @@ describe ModuleCluster::Define::Block::Class do
|
|
80
80
|
#############################
|
81
81
|
|
82
82
|
it 'can run a block on class include or extend' do
|
83
|
-
module ModuleCluster::Define::Block::Class::Mock03
|
83
|
+
module ::ModuleCluster::Define::Block::Class::Mock03
|
84
84
|
extend ::ModuleCluster::Define::Block::Class
|
85
85
|
block_ran = false
|
86
86
|
class_include_or_extend do
|
87
87
|
block_ran = true
|
88
|
-
self.should == ModuleCluster::Define::Block::Class::Mock03
|
88
|
+
self.should == ::ModuleCluster::Define::Block::Class::Mock03
|
89
89
|
end
|
90
90
|
respond_to?( :extended ).should == true
|
91
91
|
module ModuleProof
|
@@ -117,12 +117,12 @@ describe ModuleCluster::Define::Block::Class do
|
|
117
117
|
###########################
|
118
118
|
|
119
119
|
it 'can run a block before class include' do
|
120
|
-
module ModuleCluster::Define::Block::Class::Mock04
|
120
|
+
module ::ModuleCluster::Define::Block::Class::Mock04
|
121
121
|
extend ::ModuleCluster::Define::Block::Class
|
122
122
|
block_ran = false
|
123
123
|
prepend_class_include do
|
124
124
|
block_ran = true
|
125
|
-
self.should == ModuleCluster::Define::Block::Class::Mock04
|
125
|
+
self.should == ::ModuleCluster::Define::Block::Class::Mock04
|
126
126
|
end
|
127
127
|
respond_to?( :included ).should == true
|
128
128
|
module ModuleProof
|
@@ -153,12 +153,12 @@ describe ModuleCluster::Define::Block::Class do
|
|
153
153
|
##########################
|
154
154
|
|
155
155
|
it 'can run a block before class extend' do
|
156
|
-
module ModuleCluster::Define::Block::Class::Mock05
|
156
|
+
module ::ModuleCluster::Define::Block::Class::Mock05
|
157
157
|
extend ::ModuleCluster::Define::Block::Class
|
158
158
|
block_ran = false
|
159
159
|
prepend_class_extend do
|
160
160
|
block_ran = true
|
161
|
-
self.should == ModuleCluster::Define::Block::Class::Mock05
|
161
|
+
self.should == ::ModuleCluster::Define::Block::Class::Mock05
|
162
162
|
end
|
163
163
|
respond_to?( :extended ).should == true
|
164
164
|
module ModuleProof
|
@@ -189,12 +189,12 @@ describe ModuleCluster::Define::Block::Class do
|
|
189
189
|
#####################################
|
190
190
|
|
191
191
|
it 'can run a block before class include or extend' do
|
192
|
-
module ModuleCluster::Define::Block::Class::Mock06
|
192
|
+
module ::ModuleCluster::Define::Block::Class::Mock06
|
193
193
|
extend ::ModuleCluster::Define::Block::Class
|
194
194
|
block_ran = false
|
195
195
|
prepend_class_include_or_extend do
|
196
196
|
block_ran = true
|
197
|
-
self.should == ModuleCluster::Define::Block::Class::Mock06
|
197
|
+
self.should == ::ModuleCluster::Define::Block::Class::Mock06
|
198
198
|
end
|
199
199
|
respond_to?( :extended ).should == true
|
200
200
|
module ModuleProof
|
@@ -1,19 +1,19 @@
|
|
1
1
|
|
2
2
|
require_relative '../../../../lib/module-cluster.rb'
|
3
3
|
|
4
|
-
describe ModuleCluster::Define::Block::Instance do
|
4
|
+
describe ::ModuleCluster::Define::Block::Instance do
|
5
5
|
|
6
6
|
#####################
|
7
7
|
# instance_extend #
|
8
8
|
#####################
|
9
9
|
|
10
10
|
it 'can run a block on instance extend' do
|
11
|
-
module ModuleCluster::Define::Block::Instance::Mock01
|
11
|
+
module ::ModuleCluster::Define::Block::Instance::Mock01
|
12
12
|
extend ::ModuleCluster::Define::Block::Instance
|
13
13
|
block_ran = false
|
14
14
|
instance_extend do
|
15
15
|
block_ran = true
|
16
|
-
self.should == ModuleCluster::Define::Block::Instance::Mock01
|
16
|
+
self.should == ::ModuleCluster::Define::Block::Instance::Mock01
|
17
17
|
end
|
18
18
|
respond_to?( :extended ).should == true
|
19
19
|
module ModuleProof
|
@@ -44,12 +44,12 @@ describe ModuleCluster::Define::Block::Instance do
|
|
44
44
|
#############################
|
45
45
|
|
46
46
|
it 'can run a block before instance extend' do
|
47
|
-
module ModuleCluster::Define::Block::Instance::Mock02
|
47
|
+
module ::ModuleCluster::Define::Block::Instance::Mock02
|
48
48
|
extend ::ModuleCluster::Define::Block::Instance
|
49
49
|
block_ran = false
|
50
50
|
prepend_instance_extend do
|
51
51
|
block_ran = true
|
52
|
-
self.should == ModuleCluster::Define::Block::Instance::Mock02
|
52
|
+
self.should == ::ModuleCluster::Define::Block::Instance::Mock02
|
53
53
|
end
|
54
54
|
respond_to?( :extended ).should == true
|
55
55
|
module ModuleProof
|
@@ -1,14 +1,14 @@
|
|
1
1
|
|
2
2
|
require_relative '../../../../lib/module-cluster.rb'
|
3
3
|
|
4
|
-
describe ModuleCluster::Define::Block::ModuleOrSubclass do
|
4
|
+
describe ::ModuleCluster::Define::Block::ModuleOrSubclass do
|
5
5
|
|
6
6
|
################################
|
7
7
|
# module_include_or_subclass #
|
8
8
|
################################
|
9
9
|
|
10
10
|
it 'can run a block on class or module extend' do
|
11
|
-
module ModuleCluster::Define::Block::ModuleOrSubclass::Mock01
|
11
|
+
module ::ModuleCluster::Define::Block::ModuleOrSubclass::Mock01
|
12
12
|
extend ::ModuleCluster::Define::Block::ModuleOrSubclass
|
13
13
|
block_ran = false
|
14
14
|
module_include_or_subclass do
|
@@ -39,12 +39,10 @@ describe ModuleCluster::Define::Block::ModuleOrSubclass do
|
|
39
39
|
end
|
40
40
|
block_ran.should == false
|
41
41
|
class SubClassProof < ClassProof
|
42
|
-
include ::ModuleCluster::Define::Block::ModuleOrSubclass::Mock01
|
43
42
|
end
|
44
43
|
block_ran.should == true
|
45
44
|
block_ran = false
|
46
45
|
class SubSubClassProof < SubClassProof
|
47
|
-
include ::ModuleCluster::Define::Block::ModuleOrSubclass::Mock01
|
48
46
|
end
|
49
47
|
block_ran.should == true
|
50
48
|
end
|
@@ -1,19 +1,19 @@
|
|
1
1
|
|
2
2
|
require_relative '../../../../lib/module-cluster.rb'
|
3
3
|
|
4
|
-
describe ModuleCluster::Define::Block::Module do
|
4
|
+
describe ::ModuleCluster::Define::Block::Module do
|
5
5
|
|
6
6
|
####################
|
7
7
|
# module_include #
|
8
8
|
####################
|
9
9
|
|
10
10
|
it 'can run a block on module include' do
|
11
|
-
module ModuleCluster::Define::Block::Module::Mock01
|
11
|
+
module ::ModuleCluster::Define::Block::Module::Mock01
|
12
12
|
extend ::ModuleCluster::Define::Block::Module
|
13
13
|
block_ran = false
|
14
14
|
module_include do
|
15
15
|
block_ran = true
|
16
|
-
self.should == ModuleCluster::Define::Block::Module::Mock01
|
16
|
+
self.should == ::ModuleCluster::Define::Block::Module::Mock01
|
17
17
|
end
|
18
18
|
respond_to?( :included ).should == true
|
19
19
|
class ClassProof
|
@@ -44,12 +44,12 @@ describe ModuleCluster::Define::Block::Module do
|
|
44
44
|
###################
|
45
45
|
|
46
46
|
it 'can run a block on module extend' do
|
47
|
-
module ModuleCluster::Define::Block::Module::Mock02
|
47
|
+
module ::ModuleCluster::Define::Block::Module::Mock02
|
48
48
|
extend ::ModuleCluster::Define::Block::Module
|
49
49
|
block_ran = false
|
50
50
|
module_extend do
|
51
51
|
block_ran = true
|
52
|
-
self.should == ModuleCluster::Define::Block::Module::Mock02
|
52
|
+
self.should == ::ModuleCluster::Define::Block::Module::Mock02
|
53
53
|
end
|
54
54
|
respond_to?( :extended ).should == true
|
55
55
|
class ClassProof
|
@@ -80,12 +80,12 @@ describe ModuleCluster::Define::Block::Module do
|
|
80
80
|
##############################
|
81
81
|
|
82
82
|
it 'can run a block on module include or extend' do
|
83
|
-
module ModuleCluster::Define::Block::Module::Mock03
|
83
|
+
module ::ModuleCluster::Define::Block::Module::Mock03
|
84
84
|
extend ::ModuleCluster::Define::Block::Module
|
85
85
|
block_ran = false
|
86
86
|
module_include_or_extend do
|
87
87
|
block_ran = true
|
88
|
-
self.should == ModuleCluster::Define::Block::Module::Mock03
|
88
|
+
self.should == ::ModuleCluster::Define::Block::Module::Mock03
|
89
89
|
end
|
90
90
|
respond_to?( :extended ).should == true
|
91
91
|
class ClassProof
|
@@ -117,12 +117,12 @@ describe ModuleCluster::Define::Block::Module do
|
|
117
117
|
############################
|
118
118
|
|
119
119
|
it 'can run a block before module include' do
|
120
|
-
module ModuleCluster::Define::Block::Module::Mock04
|
120
|
+
module ::ModuleCluster::Define::Block::Module::Mock04
|
121
121
|
extend ::ModuleCluster::Define::Block::Module
|
122
122
|
block_ran = false
|
123
123
|
prepend_module_include do
|
124
124
|
block_ran = true
|
125
|
-
self.should == ModuleCluster::Define::Block::Module::Mock04
|
125
|
+
self.should == ::ModuleCluster::Define::Block::Module::Mock04
|
126
126
|
end
|
127
127
|
respond_to?( :included ).should == true
|
128
128
|
class ClassProof
|
@@ -153,12 +153,12 @@ describe ModuleCluster::Define::Block::Module do
|
|
153
153
|
###########################
|
154
154
|
|
155
155
|
it 'can run a block before module extend' do
|
156
|
-
module ModuleCluster::Define::Block::Module::Mock05
|
156
|
+
module ::ModuleCluster::Define::Block::Module::Mock05
|
157
157
|
extend ::ModuleCluster::Define::Block::Module
|
158
158
|
block_ran = false
|
159
159
|
prepend_module_extend do
|
160
160
|
block_ran = true
|
161
|
-
self.should == ModuleCluster::Define::Block::Module::Mock05
|
161
|
+
self.should == ::ModuleCluster::Define::Block::Module::Mock05
|
162
162
|
end
|
163
163
|
respond_to?( :extended ).should == true
|
164
164
|
class ClassProof
|
@@ -189,12 +189,12 @@ describe ModuleCluster::Define::Block::Module do
|
|
189
189
|
######################################
|
190
190
|
|
191
191
|
it 'can run a block before module include or extend' do
|
192
|
-
module ModuleCluster::Define::Block::Module::Mock06
|
192
|
+
module ::ModuleCluster::Define::Block::Module::Mock06
|
193
193
|
extend ::ModuleCluster::Define::Block::Module
|
194
194
|
block_ran = false
|
195
195
|
prepend_module_include_or_extend do
|
196
196
|
block_ran = true
|
197
|
-
self.should == ModuleCluster::Define::Block::Module::Mock06
|
197
|
+
self.should == ::ModuleCluster::Define::Block::Module::Mock06
|
198
198
|
end
|
199
199
|
respond_to?( :extended ).should == true
|
200
200
|
class ClassProof
|
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
require_relative '../../../../lib/module-cluster.rb'
|
3
3
|
|
4
|
-
describe ModuleCluster::Define::Block::Subclass do
|
4
|
+
describe ::ModuleCluster::Define::Block::Subclass do
|
5
5
|
|
6
6
|
##############
|
7
7
|
# subclass #
|
@@ -9,13 +9,13 @@ describe ModuleCluster::Define::Block::Subclass do
|
|
9
9
|
|
10
10
|
it 'can run a block when a class is subclassed' do
|
11
11
|
|
12
|
-
class ModuleCluster::Define::Block::Subclass::Mock01
|
12
|
+
class ::ModuleCluster::Define::Block::Subclass::Mock01
|
13
13
|
extend ::ModuleCluster::Define::Block::Subclass
|
14
14
|
block_ran = false
|
15
15
|
subclass do |subclass_instance|
|
16
16
|
subclass_instance.ancestors[ 1 ].should == self
|
17
|
-
self.ancestors.include?( ModuleCluster::Define::Block::Subclass::Mock01 ).should == true
|
18
|
-
subclass_instance.ancestors.include?( ModuleCluster::Define::Block::Subclass::Mock01 ).should == true
|
17
|
+
self.ancestors.include?( ::ModuleCluster::Define::Block::Subclass::Mock01 ).should == true
|
18
|
+
subclass_instance.ancestors.include?( ::ModuleCluster::Define::Block::Subclass::Mock01 ).should == true
|
19
19
|
block_ran = true
|
20
20
|
end
|
21
21
|
respond_to?( :inherited ).should == true
|
@@ -23,7 +23,7 @@ describe ModuleCluster::Define::Block::Subclass do
|
|
23
23
|
respond_to?( :extended ).should == false
|
24
24
|
respond_to?( :append_features ).should == false
|
25
25
|
respond_to?( :extend_object ).should == false
|
26
|
-
class ModuleProof < ModuleCluster::Define::Block::Subclass::Mock01
|
26
|
+
class ModuleProof < ::ModuleCluster::Define::Block::Subclass::Mock01
|
27
27
|
end
|
28
28
|
block_ran.should == true
|
29
29
|
block_ran = false
|
@@ -35,13 +35,13 @@ describe ModuleCluster::Define::Block::Subclass do
|
|
35
35
|
|
36
36
|
it 'can run a block when a class is subclassed after a module has defined subclassing' do
|
37
37
|
|
38
|
-
module ModuleCluster::Define::Block::Subclass::Mock02
|
38
|
+
module ::ModuleCluster::Define::Block::Subclass::Mock02
|
39
39
|
extend ::ModuleCluster::Define::Block::Subclass
|
40
40
|
block_ran = false
|
41
41
|
subclass do |subclass_instance|
|
42
42
|
subclass_instance.ancestors[ 1 ].should == self
|
43
|
-
self.ancestors.include?( ModuleCluster::Define::Block::Subclass::Mock02 ).should == true
|
44
|
-
subclass_instance.ancestors.include?( ModuleCluster::Define::Block::Subclass::Mock02 ).should == true
|
43
|
+
self.ancestors.include?( ::ModuleCluster::Define::Block::Subclass::Mock02 ).should == true
|
44
|
+
subclass_instance.ancestors.include?( ::ModuleCluster::Define::Block::Subclass::Mock02 ).should == true
|
45
45
|
block_ran = true
|
46
46
|
end
|
47
47
|
respond_to?( :included ).should == true
|
@@ -1,17 +1,17 @@
|
|
1
1
|
|
2
2
|
require_relative '../../../lib/module-cluster.rb'
|
3
3
|
|
4
|
-
describe ModuleCluster::Define::Block do
|
4
|
+
describe ::ModuleCluster::Define::Block do
|
5
5
|
|
6
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
|
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
15
|
end
|
16
16
|
end
|
17
17
|
|