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,7 +1,7 @@
|
|
1
1
|
|
2
2
|
require_relative '../../../../../lib/module-cluster.rb'
|
3
3
|
|
4
|
-
describe ModuleCluster::ClusterStack::Set::MultiSetProxy do
|
4
|
+
describe ::ModuleCluster::ClusterStack::Set::MultiSetProxy do
|
5
5
|
|
6
6
|
###########
|
7
7
|
# name= #
|
@@ -9,29 +9,29 @@ describe ModuleCluster::ClusterStack::Set::MultiSetProxy do
|
|
9
9
|
###########
|
10
10
|
|
11
11
|
it 'can set the name of each member set and retrieve the names of each member set' do
|
12
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01
|
12
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01
|
13
13
|
end
|
14
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02
|
14
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02
|
15
15
|
end
|
16
|
-
set_one = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01 ], nil )
|
17
|
-
set_two = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02 ], nil )
|
16
|
+
set_one = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01 ], nil )
|
17
|
+
set_two = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02 ], nil )
|
18
18
|
set_one.name = :some_name
|
19
19
|
set_two.name = :some_other_name
|
20
|
-
multi_set = ModuleCluster::ClusterStack::Set::MultiSetProxy.new( set_one, set_two )
|
20
|
+
multi_set = ::ModuleCluster::ClusterStack::Set::MultiSetProxy.new( set_one, set_two )
|
21
21
|
multi_set.name.should == [ :some_name, :some_other_name ]
|
22
22
|
multi_set.name = :yet_another_other_name
|
23
23
|
multi_set.name.should == [ :yet_another_other_name, :yet_another_other_name ]
|
24
24
|
# also make sure it works nested in another MultiSetProxy
|
25
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03
|
25
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03
|
26
26
|
end
|
27
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04
|
27
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04
|
28
28
|
end
|
29
|
-
set_three = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03 ], nil )
|
30
|
-
set_four = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04 ], nil )
|
29
|
+
set_three = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03 ], nil )
|
30
|
+
set_four = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04 ], nil )
|
31
31
|
set_three.name = :some_name
|
32
32
|
set_four.name = :some_other_name
|
33
|
-
multi_set_two = ModuleCluster::ClusterStack::Set::MultiSetProxy.new( set_three, set_four )
|
34
|
-
multi_multi_set = ModuleCluster::ClusterStack::Set::MultiSetProxy.new( multi_set, multi_set_two )
|
33
|
+
multi_set_two = ::ModuleCluster::ClusterStack::Set::MultiSetProxy.new( set_three, set_four )
|
34
|
+
multi_multi_set = ::ModuleCluster::ClusterStack::Set::MultiSetProxy.new( multi_set, multi_set_two )
|
35
35
|
multi_multi_set.name.should == [ :yet_another_other_name, :yet_another_other_name, :some_name, :some_other_name ]
|
36
36
|
end
|
37
37
|
|
@@ -41,30 +41,30 @@ describe ModuleCluster::ClusterStack::Set::MultiSetProxy do
|
|
41
41
|
########################
|
42
42
|
|
43
43
|
it 'can set the dependecy module of each member set and retrieve the dependency module of each member set' do
|
44
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01
|
44
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01
|
45
45
|
end
|
46
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02
|
46
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02
|
47
47
|
end
|
48
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::DependencyModuleMock01
|
48
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::DependencyModuleMock01
|
49
49
|
end
|
50
|
-
set_one = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01 ], nil )
|
51
|
-
set_two = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02 ], nil )
|
52
|
-
multi_set = ModuleCluster::ClusterStack::Set::MultiSetProxy.new( set_one, set_two )
|
53
|
-
multi_set.dependency_module.should == [ ModuleCluster::Define::Cluster, ModuleCluster::Define::Cluster ]
|
54
|
-
multi_set.dependency_module = ModuleCluster::ClusterStack::Set::MultiSetProxy::DependencyModuleMock01
|
55
|
-
multi_set.dependency_module.should == [ ModuleCluster::ClusterStack::Set::MultiSetProxy::DependencyModuleMock01, ModuleCluster::ClusterStack::Set::MultiSetProxy::DependencyModuleMock01 ]
|
50
|
+
set_one = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01 ], nil )
|
51
|
+
set_two = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02 ], nil )
|
52
|
+
multi_set = ::ModuleCluster::ClusterStack::Set::MultiSetProxy.new( set_one, set_two )
|
53
|
+
multi_set.dependency_module.should == [ ::ModuleCluster::Define::Cluster, ::ModuleCluster::Define::Cluster ]
|
54
|
+
multi_set.dependency_module = ::ModuleCluster::ClusterStack::Set::MultiSetProxy::DependencyModuleMock01
|
55
|
+
multi_set.dependency_module.should == [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::DependencyModuleMock01, ::ModuleCluster::ClusterStack::Set::MultiSetProxy::DependencyModuleMock01 ]
|
56
56
|
# also make sure it works nested in another MultiSetProxy
|
57
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03
|
57
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03
|
58
58
|
end
|
59
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04
|
59
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04
|
60
60
|
end
|
61
|
-
set_three = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03 ], nil )
|
62
|
-
set_four = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04 ], nil )
|
61
|
+
set_three = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03 ], nil )
|
62
|
+
set_four = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04 ], nil )
|
63
63
|
set_three.name = :some_name
|
64
64
|
set_four.name = :some_other_name
|
65
|
-
multi_set_two = ModuleCluster::ClusterStack::Set::MultiSetProxy.new( set_three, set_four )
|
66
|
-
multi_multi_set = ModuleCluster::ClusterStack::Set::MultiSetProxy.new( multi_set, multi_set_two )
|
67
|
-
multi_multi_set.dependency_module.should == [ ModuleCluster::ClusterStack::Set::MultiSetProxy::DependencyModuleMock01, ModuleCluster::ClusterStack::Set::MultiSetProxy::DependencyModuleMock01, ModuleCluster::Define::Cluster, ModuleCluster::Define::Cluster ]
|
65
|
+
multi_set_two = ::ModuleCluster::ClusterStack::Set::MultiSetProxy.new( set_three, set_four )
|
66
|
+
multi_multi_set = ::ModuleCluster::ClusterStack::Set::MultiSetProxy.new( multi_set, multi_set_two )
|
67
|
+
multi_multi_set.dependency_module.should == [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::DependencyModuleMock01, ::ModuleCluster::ClusterStack::Set::MultiSetProxy::DependencyModuleMock01, ::ModuleCluster::Define::Cluster, ::ModuleCluster::Define::Cluster ]
|
68
68
|
end
|
69
69
|
|
70
70
|
#############
|
@@ -73,27 +73,27 @@ describe ModuleCluster::ClusterStack::Set::MultiSetProxy do
|
|
73
73
|
#############
|
74
74
|
|
75
75
|
it 'can set the method of each member set and retrieve the methods of each member set' do
|
76
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01
|
76
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01
|
77
77
|
end
|
78
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02
|
78
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02
|
79
79
|
end
|
80
|
-
set_one = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01 ], nil )
|
81
|
-
set_two = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02 ], nil )
|
82
|
-
multi_set = ModuleCluster::ClusterStack::Set::MultiSetProxy.new( set_one, set_two )
|
80
|
+
set_one = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01 ], nil )
|
81
|
+
set_two = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02 ], nil )
|
82
|
+
multi_set = ::ModuleCluster::ClusterStack::Set::MultiSetProxy.new( set_one, set_two )
|
83
83
|
multi_set.method.should == [ :include_also_includes, :include_also_includes ]
|
84
84
|
multi_set.method = :some_other_method
|
85
85
|
multi_set.method.should == [ :some_other_method, :some_other_method ]
|
86
86
|
# also make sure it works nested in another MultiSetProxy
|
87
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03
|
87
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03
|
88
88
|
end
|
89
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04
|
89
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04
|
90
90
|
end
|
91
|
-
set_three = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03 ], nil )
|
92
|
-
set_four = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04 ], nil )
|
91
|
+
set_three = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03 ], nil )
|
92
|
+
set_four = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04 ], nil )
|
93
93
|
set_three.name = :some_name
|
94
94
|
set_four.name = :some_other_name
|
95
|
-
multi_set_two = ModuleCluster::ClusterStack::Set::MultiSetProxy.new( set_three, set_four )
|
96
|
-
multi_multi_set = ModuleCluster::ClusterStack::Set::MultiSetProxy.new( multi_set, multi_set_two )
|
95
|
+
multi_set_two = ::ModuleCluster::ClusterStack::Set::MultiSetProxy.new( set_three, set_four )
|
96
|
+
multi_multi_set = ::ModuleCluster::ClusterStack::Set::MultiSetProxy.new( multi_set, multi_set_two )
|
97
97
|
multi_multi_set.method.should == [ :some_other_method, :some_other_method, :include_also_includes, :include_also_includes ]
|
98
98
|
end
|
99
99
|
|
@@ -103,27 +103,27 @@ describe ModuleCluster::ClusterStack::Set::MultiSetProxy do
|
|
103
103
|
###################################
|
104
104
|
|
105
105
|
it 'can set the object to which set applies for each member set and retrieve the objects to which sets apply for all member sets' do
|
106
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01
|
106
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01
|
107
107
|
end
|
108
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02
|
108
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02
|
109
109
|
end
|
110
|
-
set_one = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01 ], nil )
|
111
|
-
set_two = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02 ], nil )
|
112
|
-
multi_set = ModuleCluster::ClusterStack::Set::MultiSetProxy.new( set_one, set_two )
|
110
|
+
set_one = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01 ], nil )
|
111
|
+
set_two = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02 ], nil )
|
112
|
+
multi_set = ::ModuleCluster::ClusterStack::Set::MultiSetProxy.new( set_one, set_two )
|
113
113
|
multi_set.module_class_instance_or_all.should == [ :all, :all ]
|
114
114
|
multi_set.module_class_instance_or_all = :module
|
115
115
|
multi_set.module_class_instance_or_all.should == [ :module, :module ]
|
116
116
|
# also make sure it works nested in another MultiSetProxy
|
117
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03
|
117
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03
|
118
118
|
end
|
119
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04
|
119
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04
|
120
120
|
end
|
121
|
-
set_three = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03 ], nil )
|
122
|
-
set_four = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04 ], nil )
|
121
|
+
set_three = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03 ], nil )
|
122
|
+
set_four = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04 ], nil )
|
123
123
|
set_three.name = :some_name
|
124
124
|
set_four.name = :some_other_name
|
125
|
-
multi_set_two = ModuleCluster::ClusterStack::Set::MultiSetProxy.new( set_three, set_four )
|
126
|
-
multi_multi_set = ModuleCluster::ClusterStack::Set::MultiSetProxy.new( multi_set, multi_set_two )
|
125
|
+
multi_set_two = ::ModuleCluster::ClusterStack::Set::MultiSetProxy.new( set_three, set_four )
|
126
|
+
multi_multi_set = ::ModuleCluster::ClusterStack::Set::MultiSetProxy.new( multi_set, multi_set_two )
|
127
127
|
multi_multi_set.module_class_instance_or_all.should == [ :module, :module, :all, :all ]
|
128
128
|
end
|
129
129
|
|
@@ -133,27 +133,27 @@ describe ModuleCluster::ClusterStack::Set::MultiSetProxy do
|
|
133
133
|
########################
|
134
134
|
|
135
135
|
it 'can set whether set should be used to include, extend, or both and retrieve whether member sets are to be included, extended, or both' do
|
136
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01
|
136
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01
|
137
137
|
end
|
138
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02
|
138
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02
|
139
139
|
end
|
140
|
-
set_one = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01 ], nil )
|
141
|
-
set_two = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02 ], nil )
|
142
|
-
multi_set = ModuleCluster::ClusterStack::Set::MultiSetProxy.new( set_one, set_two )
|
140
|
+
set_one = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01 ], nil )
|
141
|
+
set_two = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02 ], nil )
|
142
|
+
multi_set = ::ModuleCluster::ClusterStack::Set::MultiSetProxy.new( set_one, set_two )
|
143
143
|
multi_set.include_or_extend.should == [ :include_also_includes, :include_also_includes ]
|
144
144
|
multi_set.include_or_extend = :module
|
145
145
|
multi_set.include_or_extend.should == [ :module, :module ]
|
146
146
|
# also make sure it works nested in another MultiSetProxy
|
147
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03
|
147
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03
|
148
148
|
end
|
149
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04
|
149
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04
|
150
150
|
end
|
151
|
-
set_three = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03 ], nil )
|
152
|
-
set_four = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04 ], nil )
|
151
|
+
set_three = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03 ], nil )
|
152
|
+
set_four = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04 ], nil )
|
153
153
|
set_three.name = :some_name
|
154
154
|
set_four.name = :some_other_name
|
155
|
-
multi_set_two = ModuleCluster::ClusterStack::Set::MultiSetProxy.new( set_three, set_four )
|
156
|
-
multi_multi_set = ModuleCluster::ClusterStack::Set::MultiSetProxy.new( multi_set, multi_set_two )
|
155
|
+
multi_set_two = ::ModuleCluster::ClusterStack::Set::MultiSetProxy.new( set_three, set_four )
|
156
|
+
multi_multi_set = ::ModuleCluster::ClusterStack::Set::MultiSetProxy.new( multi_set, multi_set_two )
|
157
157
|
multi_multi_set.include_or_extend.should == [ :module, :module, :include_also_includes, :include_also_includes ]
|
158
158
|
end
|
159
159
|
|
@@ -163,31 +163,31 @@ describe ModuleCluster::ClusterStack::Set::MultiSetProxy do
|
|
163
163
|
##############
|
164
164
|
|
165
165
|
it 'can set the modules of each member set and retrieve the modules of each member set' do
|
166
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01
|
166
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01
|
167
167
|
end
|
168
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02
|
168
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02
|
169
169
|
end
|
170
|
-
set_one = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01 ], nil )
|
171
|
-
set_two = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02 ], nil )
|
172
|
-
multi_set = ModuleCluster::ClusterStack::Set::MultiSetProxy.new( set_one, set_two )
|
173
|
-
multi_set.modules.should == [ [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01 ], [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02 ] ]
|
170
|
+
set_one = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01 ], nil )
|
171
|
+
set_two = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02 ], nil )
|
172
|
+
multi_set = ::ModuleCluster::ClusterStack::Set::MultiSetProxy.new( set_one, set_two )
|
173
|
+
multi_set.modules.should == [ [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01 ], [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02 ] ]
|
174
174
|
multi_set.modules = [ Module ]
|
175
175
|
multi_set.modules.should == [ [ Module ], [ Module ] ]
|
176
176
|
# also make sure it works nested in another MultiSetProxy
|
177
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03
|
177
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03
|
178
178
|
end
|
179
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04
|
179
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04
|
180
180
|
end
|
181
|
-
set_three = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03 ], nil )
|
182
|
-
set_four = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04 ], nil )
|
181
|
+
set_three = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03 ], nil )
|
182
|
+
set_four = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04 ], nil )
|
183
183
|
set_three.name = :some_name
|
184
184
|
set_four.name = :some_other_name
|
185
|
-
multi_set_two = ModuleCluster::ClusterStack::Set::MultiSetProxy.new( set_three, set_four )
|
186
|
-
multi_multi_set = ModuleCluster::ClusterStack::Set::MultiSetProxy.new( multi_set, multi_set_two )
|
187
|
-
multi_multi_set.modules.should == [ [ Module ], [ Module ], [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03 ], [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04 ] ]
|
188
|
-
set_five = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03 ], nil )
|
189
|
-
multi_multi_set_two = ModuleCluster::ClusterStack::Set::MultiSetProxy.new( multi_multi_set, set_five )
|
190
|
-
multi_multi_set_two.modules.should == [ [ Module ], [ Module ], [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03 ], [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04 ], [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03 ] ]
|
185
|
+
multi_set_two = ::ModuleCluster::ClusterStack::Set::MultiSetProxy.new( set_three, set_four )
|
186
|
+
multi_multi_set = ::ModuleCluster::ClusterStack::Set::MultiSetProxy.new( multi_set, multi_set_two )
|
187
|
+
multi_multi_set.modules.should == [ [ Module ], [ Module ], [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03 ], [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04 ] ]
|
188
|
+
set_five = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03 ], nil )
|
189
|
+
multi_multi_set_two = ::ModuleCluster::ClusterStack::Set::MultiSetProxy.new( multi_multi_set, set_five )
|
190
|
+
multi_multi_set_two.modules.should == [ [ Module ], [ Module ], [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03 ], [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04 ], [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03 ] ]
|
191
191
|
end
|
192
192
|
|
193
193
|
########################################
|
@@ -196,29 +196,29 @@ describe ModuleCluster::ClusterStack::Set::MultiSetProxy do
|
|
196
196
|
########################################
|
197
197
|
|
198
198
|
it 'can set the block for runtime determination of modules for each member set and retrieve the block from each member set' do
|
199
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01
|
199
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01
|
200
200
|
end
|
201
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02
|
201
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02
|
202
202
|
end
|
203
203
|
runtime_block = Proc.new { Module }
|
204
|
-
set_one = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01 ], runtime_block )
|
205
|
-
set_two = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02 ], runtime_block )
|
206
|
-
multi_set = ModuleCluster::ClusterStack::Set::MultiSetProxy.new( set_one, set_two )
|
204
|
+
set_one = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01 ], runtime_block )
|
205
|
+
set_two = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02 ], runtime_block )
|
206
|
+
multi_set = ::ModuleCluster::ClusterStack::Set::MultiSetProxy.new( set_one, set_two )
|
207
207
|
multi_set.runtime_includes_or_extends_block.should == [ runtime_block, runtime_block ]
|
208
208
|
other_block = Proc.new { Kernel }
|
209
209
|
multi_set.runtime_includes_or_extends_block = other_block
|
210
210
|
multi_set.runtime_includes_or_extends_block.should == [ other_block, other_block ]
|
211
211
|
# also make sure it works nested in another MultiSetProxy
|
212
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03
|
212
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03
|
213
213
|
end
|
214
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04
|
214
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04
|
215
215
|
end
|
216
|
-
set_three = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03 ], runtime_block )
|
217
|
-
set_four = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04 ], runtime_block )
|
216
|
+
set_three = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03 ], runtime_block )
|
217
|
+
set_four = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04 ], runtime_block )
|
218
218
|
set_three.name = :some_name
|
219
219
|
set_four.name = :some_other_name
|
220
|
-
multi_set_two = ModuleCluster::ClusterStack::Set::MultiSetProxy.new( set_three, set_four )
|
221
|
-
multi_multi_set = ModuleCluster::ClusterStack::Set::MultiSetProxy.new( multi_set, multi_set_two )
|
220
|
+
multi_set_two = ::ModuleCluster::ClusterStack::Set::MultiSetProxy.new( set_three, set_four )
|
221
|
+
multi_multi_set = ::ModuleCluster::ClusterStack::Set::MultiSetProxy.new( multi_set, multi_set_two )
|
222
222
|
multi_multi_set.runtime_includes_or_extends_block.should == [ other_block, other_block, runtime_block, runtime_block ]
|
223
223
|
end
|
224
224
|
|
@@ -231,13 +231,13 @@ describe ModuleCluster::ClusterStack::Set::MultiSetProxy do
|
|
231
231
|
################
|
232
232
|
|
233
233
|
it 'can suspend and resume each member set and retrieve whether member sets are suspended' do
|
234
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01
|
234
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01
|
235
235
|
end
|
236
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02
|
236
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02
|
237
237
|
end
|
238
|
-
set_one = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01 ], nil )
|
239
|
-
set_two = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02 ], nil )
|
240
|
-
multi_set = ModuleCluster::ClusterStack::Set::MultiSetProxy.new( set_one, set_two )
|
238
|
+
set_one = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01 ], nil )
|
239
|
+
set_two = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02 ], nil )
|
240
|
+
multi_set = ::ModuleCluster::ClusterStack::Set::MultiSetProxy.new( set_one, set_two )
|
241
241
|
multi_set.suspended.should == [ false, false ]
|
242
242
|
multi_set.suspended?.should == [ false, false ]
|
243
243
|
multi_set.suspended = true
|
@@ -247,17 +247,17 @@ describe ModuleCluster::ClusterStack::Set::MultiSetProxy do
|
|
247
247
|
multi_set.suspend
|
248
248
|
multi_set.suspended.should == [ true, true ]
|
249
249
|
# also make sure it works nested in another MultiSetProxy
|
250
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03
|
250
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03
|
251
251
|
end
|
252
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04
|
252
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04
|
253
253
|
end
|
254
|
-
set_three = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03 ], nil )
|
255
|
-
set_four = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04 ], nil )
|
254
|
+
set_three = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03 ], nil )
|
255
|
+
set_four = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04 ], nil )
|
256
256
|
set_three.name = :some_name
|
257
257
|
set_four.name = :some_other_name
|
258
|
-
multi_set_two = ModuleCluster::ClusterStack::Set::MultiSetProxy.new( set_three, set_four )
|
258
|
+
multi_set_two = ::ModuleCluster::ClusterStack::Set::MultiSetProxy.new( set_three, set_four )
|
259
259
|
multi_set_two.suspended.should == [ false, false ]
|
260
|
-
multi_multi_set = ModuleCluster::ClusterStack::Set::MultiSetProxy.new( multi_set, multi_set_two )
|
260
|
+
multi_multi_set = ::ModuleCluster::ClusterStack::Set::MultiSetProxy.new( multi_set, multi_set_two )
|
261
261
|
multi_multi_set.suspended?.should == [ true, true, false, false ]
|
262
262
|
end
|
263
263
|
|
@@ -267,9 +267,9 @@ describe ModuleCluster::ClusterStack::Set::MultiSetProxy do
|
|
267
267
|
|
268
268
|
it 'can return hooks in the set matching the description' do
|
269
269
|
|
270
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01
|
270
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01
|
271
271
|
end
|
272
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02
|
272
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02
|
273
273
|
end
|
274
274
|
block_one = Proc.new do
|
275
275
|
puts 'nothing'
|
@@ -277,11 +277,11 @@ describe ModuleCluster::ClusterStack::Set::MultiSetProxy do
|
|
277
277
|
block_two = Proc.new do
|
278
278
|
puts 'more nothing'
|
279
279
|
end
|
280
|
-
set_one = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01 ], block_one )
|
281
|
-
set_two = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :instance, :extend, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02 ], block_two )
|
280
|
+
set_one = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01 ], block_one )
|
281
|
+
set_two = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :instance, :extend, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02 ], block_two )
|
282
282
|
set_one.name = :name_one
|
283
283
|
set_two.name = :name_two_and_three
|
284
|
-
multi_set = ModuleCluster::ClusterStack::Set::MultiSetProxy.new( set_one, set_two )
|
284
|
+
multi_set = ::ModuleCluster::ClusterStack::Set::MultiSetProxy.new( set_one, set_two )
|
285
285
|
multi_set.suspended.should == [ false, false ]
|
286
286
|
multi_set.suspended?.should == [ false, false ]
|
287
287
|
multi_set.suspended = true
|
@@ -291,25 +291,25 @@ describe ModuleCluster::ClusterStack::Set::MultiSetProxy do
|
|
291
291
|
multi_set.suspend
|
292
292
|
multi_set.suspended.should == [ true, true ]
|
293
293
|
# also make sure it works nested in another MultiSetProxy
|
294
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03
|
294
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03
|
295
295
|
end
|
296
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04
|
296
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04
|
297
297
|
end
|
298
298
|
block_four = Proc.new do
|
299
299
|
puts 'another nothing'
|
300
300
|
end
|
301
|
-
set_three = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :class, :include_and_extend, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03 ], nil )
|
302
|
-
set_four = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :module, :include, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04 ], block_four )
|
301
|
+
set_three = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :class, :include_and_extend, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03 ], nil )
|
302
|
+
set_four = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :module, :include, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04 ], block_four )
|
303
303
|
set_three.name = :name_two_and_three
|
304
304
|
set_four.name = :name_four
|
305
|
-
multi_set_two = ModuleCluster::ClusterStack::Set::MultiSetProxy.new( set_three, set_four )
|
305
|
+
multi_set_two = ::ModuleCluster::ClusterStack::Set::MultiSetProxy.new( set_three, set_four )
|
306
306
|
multi_set_two.suspended.should == [ false, false ]
|
307
|
-
multi_multi_set = ModuleCluster::ClusterStack::Set::MultiSetProxy.new( multi_set, multi_set_two )
|
307
|
+
multi_multi_set = ::ModuleCluster::ClusterStack::Set::MultiSetProxy.new( multi_set, multi_set_two )
|
308
308
|
|
309
309
|
# dependency_module
|
310
|
-
multi_set.hooks_with( :dependency_module => ModuleCluster::Define::Cluster ).should == [ set_one, set_two ]
|
311
|
-
multi_set_two.hooks_with( :dependency_module => ModuleCluster::Define::Cluster ).should == [ set_three, set_four ]
|
312
|
-
multi_multi_set.hooks_with( :dependency_module => ModuleCluster::Define::Cluster ).should == [ set_one, set_two, set_three, set_four ]
|
310
|
+
multi_set.hooks_with( :dependency_module => ::ModuleCluster::Define::Cluster ).should == [ set_one, set_two ]
|
311
|
+
multi_set_two.hooks_with( :dependency_module => ::ModuleCluster::Define::Cluster ).should == [ set_three, set_four ]
|
312
|
+
multi_multi_set.hooks_with( :dependency_module => ::ModuleCluster::Define::Cluster ).should == [ set_one, set_two, set_three, set_four ]
|
313
313
|
|
314
314
|
# method
|
315
315
|
multi_set.hooks_with( :method => :include_also_includes ).should == [ set_one, set_two ]
|
@@ -330,11 +330,11 @@ describe ModuleCluster::ClusterStack::Set::MultiSetProxy do
|
|
330
330
|
multi_multi_set.hooks_with( :include_or_extend => :include ).should == [ set_one, set_three, set_four ]
|
331
331
|
|
332
332
|
# modules
|
333
|
-
multi_set.hooks_with( :modules => ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01 ).should == [ set_one ]
|
334
|
-
multi_set.hooks_with( :modules => [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02 ] ).should == [ set_two ]
|
335
|
-
multi_set_two.hooks_with( :modules => [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03 ] ).should == [ set_three ]
|
336
|
-
multi_multi_set.hooks_with( :modules => ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01 ).should == [ set_one ]
|
337
|
-
multi_multi_set.hooks_with( :modules => [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04 ] ).should == [ set_four ]
|
333
|
+
multi_set.hooks_with( :modules => ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01 ).should == [ set_one ]
|
334
|
+
multi_set.hooks_with( :modules => [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02 ] ).should == [ set_two ]
|
335
|
+
multi_set_two.hooks_with( :modules => [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03 ] ).should == [ set_three ]
|
336
|
+
multi_multi_set.hooks_with( :modules => ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01 ).should == [ set_one ]
|
337
|
+
multi_multi_set.hooks_with( :modules => [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04 ] ).should == [ set_four ]
|
338
338
|
|
339
339
|
# runtime_includes_or_extends_block
|
340
340
|
multi_set.hooks_with( :runtime_includes_or_extends_block => block_one ).should == [ set_one ]
|
@@ -382,29 +382,29 @@ describe ModuleCluster::ClusterStack::Set::MultiSetProxy do
|
|
382
382
|
|
383
383
|
it 'can return a hook or set of hooks in set matching name' do
|
384
384
|
|
385
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01
|
385
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01
|
386
386
|
end
|
387
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02
|
387
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02
|
388
388
|
end
|
389
|
-
set_one = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01 ], nil )
|
390
|
-
set_two = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02 ], nil )
|
389
|
+
set_one = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock01 ], nil )
|
390
|
+
set_two = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock02 ], nil )
|
391
391
|
set_one.name = :some_name
|
392
392
|
set_two.name = :some_other_name
|
393
|
-
multi_set = ModuleCluster::ClusterStack::Set::MultiSetProxy.new( set_one, set_two )
|
393
|
+
multi_set = ::ModuleCluster::ClusterStack::Set::MultiSetProxy.new( set_one, set_two )
|
394
394
|
multi_set.name.should == [ :some_name, :some_other_name ]
|
395
395
|
multi_set.name = :yet_another_other_name
|
396
396
|
multi_set.name.should == [ :yet_another_other_name, :yet_another_other_name ]
|
397
397
|
# also make sure it works nested in another MultiSetProxy
|
398
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03
|
398
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03
|
399
399
|
end
|
400
|
-
module ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04
|
400
|
+
module ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04
|
401
401
|
end
|
402
|
-
set_three = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03 ], nil )
|
403
|
-
set_four = ModuleCluster::ClusterStack::Set.new( ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04 ], nil )
|
402
|
+
set_three = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock03 ], nil )
|
403
|
+
set_four = ::ModuleCluster::ClusterStack::Set.new( ::ModuleCluster::Define::Cluster, :include_also_includes, :all, :include, [ ::ModuleCluster::ClusterStack::Set::MultiSetProxy::Mock04 ], nil )
|
404
404
|
set_three.name = :some_name
|
405
405
|
set_four.name = :some_other_name
|
406
|
-
multi_set_two = ModuleCluster::ClusterStack::Set::MultiSetProxy.new( set_three, set_four )
|
407
|
-
multi_multi_set = ModuleCluster::ClusterStack::Set::MultiSetProxy.new( multi_set, multi_set_two )
|
406
|
+
multi_set_two = ::ModuleCluster::ClusterStack::Set::MultiSetProxy.new( set_three, set_four )
|
407
|
+
multi_multi_set = ::ModuleCluster::ClusterStack::Set::MultiSetProxy.new( multi_set, multi_set_two )
|
408
408
|
multi_multi_set.name.should == [ :yet_another_other_name, :yet_another_other_name, :some_name, :some_other_name ]
|
409
409
|
|
410
410
|
multi_set.hooks( :yet_another_other_name ).should == [ set_one, set_two ]
|
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
require_relative '../../../../lib/module-cluster.rb'
|
3
3
|
|
4
|
-
describe ModuleCluster::ClusterStack::Suspend do
|
4
|
+
describe ::ModuleCluster::ClusterStack::Suspend do
|
5
5
|
|
6
6
|
##########################
|
7
7
|
# suspend_any_hooks #
|
@@ -10,10 +10,10 @@ describe ModuleCluster::ClusterStack::Suspend do
|
|
10
10
|
##########################
|
11
11
|
|
12
12
|
it 'can suspend all hooks at once' do
|
13
|
-
class ModuleCluster::ClusterStack::Suspend::Mock01
|
13
|
+
class ::ModuleCluster::ClusterStack::Suspend::Mock01
|
14
14
|
include ::ModuleCluster::ClusterStack::Suspend
|
15
15
|
end
|
16
|
-
instance = ModuleCluster::ClusterStack::Suspend::Mock01.new
|
16
|
+
instance = ::ModuleCluster::ClusterStack::Suspend::Mock01.new
|
17
17
|
instance.all_hooks_suspended?.should == false
|
18
18
|
instance.suspend_any_hooks
|
19
19
|
instance.all_hooks_suspended?.should == true
|
@@ -34,10 +34,10 @@ describe ModuleCluster::ClusterStack::Suspend do
|
|
34
34
|
##################################
|
35
35
|
|
36
36
|
it 'can suspend all include hooks at once' do
|
37
|
-
class ModuleCluster::ClusterStack::Suspend::Mock02
|
37
|
+
class ::ModuleCluster::ClusterStack::Suspend::Mock02
|
38
38
|
include ::ModuleCluster::ClusterStack::Suspend
|
39
39
|
end
|
40
|
-
instance = ModuleCluster::ClusterStack::Suspend::Mock02.new
|
40
|
+
instance = ::ModuleCluster::ClusterStack::Suspend::Mock02.new
|
41
41
|
instance.all_include_hooks_suspended?.should == false
|
42
42
|
instance.suspend_any_include_hooks
|
43
43
|
instance.all_include_hooks_suspended?.should == true
|
@@ -56,10 +56,10 @@ describe ModuleCluster::ClusterStack::Suspend do
|
|
56
56
|
#################################
|
57
57
|
|
58
58
|
it 'can suspend all extend hooks at once' do
|
59
|
-
class ModuleCluster::ClusterStack::Suspend::Mock03
|
59
|
+
class ::ModuleCluster::ClusterStack::Suspend::Mock03
|
60
60
|
include ::ModuleCluster::ClusterStack::Suspend
|
61
61
|
end
|
62
|
-
instance = ModuleCluster::ClusterStack::Suspend::Mock03.new
|
62
|
+
instance = ::ModuleCluster::ClusterStack::Suspend::Mock03.new
|
63
63
|
instance.all_extend_hooks_suspended?.should == false
|
64
64
|
instance.suspend_any_extend_hooks
|
65
65
|
instance.all_extend_hooks_suspended?.should == true
|
@@ -78,10 +78,10 @@ describe ModuleCluster::ClusterStack::Suspend do
|
|
78
78
|
##############################
|
79
79
|
|
80
80
|
it 'can suspend all include hooks' do
|
81
|
-
class ModuleCluster::ClusterStack::Suspend::Mock04
|
81
|
+
class ::ModuleCluster::ClusterStack::Suspend::Mock04
|
82
82
|
include ::ModuleCluster::ClusterStack::Suspend
|
83
83
|
end
|
84
|
-
instance = ModuleCluster::ClusterStack::Suspend::Mock04.new
|
84
|
+
instance = ::ModuleCluster::ClusterStack::Suspend::Mock04.new
|
85
85
|
instance.include_hooks_suspended?.should == false
|
86
86
|
instance.suspend_include_hooks
|
87
87
|
instance.include_hooks_suspended?.should == true
|
@@ -102,10 +102,10 @@ describe ModuleCluster::ClusterStack::Suspend do
|
|
102
102
|
#############################
|
103
103
|
|
104
104
|
it 'can suspend all extend hooks' do
|
105
|
-
class ModuleCluster::ClusterStack::Suspend::Mock05
|
105
|
+
class ::ModuleCluster::ClusterStack::Suspend::Mock05
|
106
106
|
include ::ModuleCluster::ClusterStack::Suspend
|
107
107
|
end
|
108
|
-
instance = ModuleCluster::ClusterStack::Suspend::Mock05.new
|
108
|
+
instance = ::ModuleCluster::ClusterStack::Suspend::Mock05.new
|
109
109
|
instance.extend_hooks_suspended?.should == false
|
110
110
|
instance.suspend_extend_hooks
|
111
111
|
instance.extend_hooks_suspended?.should == true
|
@@ -126,10 +126,10 @@ describe ModuleCluster::ClusterStack::Suspend do
|
|
126
126
|
######################################
|
127
127
|
|
128
128
|
it 'can suspend all prepend include hooks' do
|
129
|
-
class ModuleCluster::ClusterStack::Suspend::Mock06
|
129
|
+
class ::ModuleCluster::ClusterStack::Suspend::Mock06
|
130
130
|
include ::ModuleCluster::ClusterStack::Suspend
|
131
131
|
end
|
132
|
-
instance = ModuleCluster::ClusterStack::Suspend::Mock06.new
|
132
|
+
instance = ::ModuleCluster::ClusterStack::Suspend::Mock06.new
|
133
133
|
instance.prepend_include_hooks_suspended?.should == false
|
134
134
|
instance.suspend_prepend_include_hooks
|
135
135
|
instance.prepend_include_hooks_suspended?.should == true
|
@@ -150,10 +150,10 @@ describe ModuleCluster::ClusterStack::Suspend do
|
|
150
150
|
#####################################
|
151
151
|
|
152
152
|
it 'can suspend all prepend extend hooks' do
|
153
|
-
class ModuleCluster::ClusterStack::Suspend::Mock07
|
153
|
+
class ::ModuleCluster::ClusterStack::Suspend::Mock07
|
154
154
|
include ::ModuleCluster::ClusterStack::Suspend
|
155
155
|
end
|
156
|
-
instance = ModuleCluster::ClusterStack::Suspend::Mock07.new
|
156
|
+
instance = ::ModuleCluster::ClusterStack::Suspend::Mock07.new
|
157
157
|
instance.prepend_extend_hooks_suspended?.should == false
|
158
158
|
instance.suspend_prepend_extend_hooks
|
159
159
|
instance.prepend_extend_hooks_suspended?.should == true
|
@@ -172,10 +172,10 @@ describe ModuleCluster::ClusterStack::Suspend do
|
|
172
172
|
######################
|
173
173
|
|
174
174
|
it 'can report whether hooks are extended for all of current action' do
|
175
|
-
class ModuleCluster::ClusterStack::Suspend::Mock08
|
175
|
+
class ::ModuleCluster::ClusterStack::Suspend::Mock08
|
176
176
|
include ::ModuleCluster::ClusterStack::Suspend
|
177
177
|
end
|
178
|
-
instance = ModuleCluster::ClusterStack::Suspend::Mock08.new
|
178
|
+
instance = ::ModuleCluster::ClusterStack::Suspend::Mock08.new
|
179
179
|
instance.hooks_suspended?( :prepend_include ).should == false
|
180
180
|
instance.hooks_suspended?( :include ).should == false
|
181
181
|
instance.hooks_suspended?( :prepend_extend ).should == false
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: module-cluster
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -44,6 +44,10 @@ files:
|
|
44
44
|
- lib/module-cluster/_private_/ModuleCluster/ClusterStack.rb
|
45
45
|
- lib/module-cluster/_private_/ModuleCluster/ExtendForCascade/Subclass.rb
|
46
46
|
- lib/module-cluster/_private_/ModuleCluster/ExtendForCascade.rb
|
47
|
+
- lib/module-cluster/ModuleCluster/Define/Block/CascadingClass.rb
|
48
|
+
- lib/module-cluster/ModuleCluster/Define/Block/CascadingClassOrModule.rb
|
49
|
+
- lib/module-cluster/ModuleCluster/Define/Block/CascadingModule.rb
|
50
|
+
- lib/module-cluster/ModuleCluster/Define/Block/CascadingModuleOrSubclass.rb
|
47
51
|
- lib/module-cluster/ModuleCluster/Define/Block/Class.rb
|
48
52
|
- lib/module-cluster/ModuleCluster/Define/Block/ClassOrInstance.rb
|
49
53
|
- lib/module-cluster/ModuleCluster/Define/Block/ClassOrModule.rb
|
@@ -77,6 +81,10 @@ files:
|
|
77
81
|
- spec/_private_/ModuleCluster/CascadeFeatures/PerformCascades_spec.rb
|
78
82
|
- spec/_private_/ModuleCluster/ClusterStack/Set/MultiSetProxy_spec.rb
|
79
83
|
- spec/_private_/ModuleCluster/ClusterStack/Suspend_spec.rb
|
84
|
+
- spec/ModuleCluster/Define/Block/CascadingClass_spec.rb
|
85
|
+
- spec/ModuleCluster/Define/Block/CascadingClassOrModule_spec.rb
|
86
|
+
- spec/ModuleCluster/Define/Block/CascadingModule_spec.rb
|
87
|
+
- spec/ModuleCluster/Define/Block/CascadingModuleOrSubclass_spec.rb
|
80
88
|
- spec/ModuleCluster/Define/Block/Class_spec.rb
|
81
89
|
- spec/ModuleCluster/Define/Block/ClassOrInstance_spec.rb
|
82
90
|
- spec/ModuleCluster/Define/Block/ClassOrModule_spec.rb
|