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.
Files changed (89) hide show
  1. data/README.md +21 -0
  2. data/README.rdoc +21 -0
  3. data/lib/module-cluster/ModuleCluster/Define/Block/CascadingClass.rb +83 -0
  4. data/lib/module-cluster/ModuleCluster/Define/Block/CascadingClassOrModule.rb +70 -0
  5. data/lib/module-cluster/ModuleCluster/Define/Block/CascadingModule.rb +79 -0
  6. data/lib/module-cluster/ModuleCluster/Define/Block/CascadingModuleOrSubclass.rb +22 -0
  7. data/lib/module-cluster/ModuleCluster/Define/Block/Class.rb +15 -7
  8. data/lib/module-cluster/ModuleCluster/Define/Block/ClassOrInstance.rb +15 -7
  9. data/lib/module-cluster/ModuleCluster/Define/Block/ClassOrModule.rb +15 -7
  10. data/lib/module-cluster/ModuleCluster/Define/Block/ClassOrModuleOrInstance.rb +15 -7
  11. data/lib/module-cluster/ModuleCluster/Define/Block/ClassOrModuleOrSubclass.rb +11 -3
  12. data/lib/module-cluster/ModuleCluster/Define/Block/ClassOrSubclass.rb +10 -2
  13. data/lib/module-cluster/ModuleCluster/Define/Block/Instance.rb +15 -3
  14. data/lib/module-cluster/ModuleCluster/Define/Block/Module.rb +15 -7
  15. data/lib/module-cluster/ModuleCluster/Define/Block/ModuleOrInstance.rb +15 -7
  16. data/lib/module-cluster/ModuleCluster/Define/Block/ModuleOrSubclass.rb +10 -2
  17. data/lib/module-cluster/ModuleCluster/Define/Block/Subclass.rb +13 -2
  18. data/lib/module-cluster/ModuleCluster/Define/Block.rb +1 -1
  19. data/lib/module-cluster/ModuleCluster/Define/ClassCluster.rb +19 -19
  20. data/lib/module-cluster/ModuleCluster/Define/ClassOrInstanceCluster.rb +34 -34
  21. data/lib/module-cluster/ModuleCluster/Define/Cluster.rb +19 -19
  22. data/lib/module-cluster/ModuleCluster/Define/ClusterCascades.rb +19 -19
  23. data/lib/module-cluster/ModuleCluster/Define/ClusterCascadesToClass.rb +19 -19
  24. data/lib/module-cluster/ModuleCluster/Define/ClusterCascadesToModule.rb +19 -19
  25. data/lib/module-cluster/ModuleCluster/Define/Deprecated.rb +1 -1
  26. data/lib/module-cluster/ModuleCluster/Define/InstanceCluster.rb +3 -3
  27. data/lib/module-cluster/ModuleCluster/Define/ModuleCluster.rb +19 -19
  28. data/lib/module-cluster/ModuleCluster/Define/ModuleOrClassCluster.rb +43 -43
  29. data/lib/module-cluster/ModuleCluster/Define/ModuleOrInstanceCluster.rb +34 -34
  30. data/lib/module-cluster/ModuleCluster/Define/Status.rb +1 -1
  31. data/lib/module-cluster/ModuleCluster/Define.rb +1 -1
  32. data/lib/module-cluster/ModuleCluster/Suspend/Hooks.rb +1 -1
  33. data/lib/module-cluster/ModuleCluster/Suspend/WithoutHooks.rb +1 -1
  34. data/lib/module-cluster/ModuleCluster/Suspend.rb +1 -1
  35. data/lib/module-cluster/ModuleCluster.rb +1 -1
  36. data/lib/module-cluster/_private_/ModuleCluster/CascadeFeatures/ClusterStack.rb +3 -3
  37. data/lib/module-cluster/_private_/ModuleCluster/CascadeFeatures/PerformCascades.rb +85 -32
  38. data/lib/module-cluster/_private_/ModuleCluster/CascadeFeatures/Subclass.rb +6 -3
  39. data/lib/module-cluster/_private_/ModuleCluster/CascadeFeatures.rb +5 -5
  40. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block/Class.rb +9 -9
  41. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block/Inherited.rb +3 -3
  42. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block/Instance.rb +5 -5
  43. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block/Module.rb +9 -9
  44. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block/Set.rb +1 -0
  45. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block.rb +1 -1
  46. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Extends.rb +13 -13
  47. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Includes.rb +10 -10
  48. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/PrependsExtends.rb +13 -13
  49. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/PrependsIncludes.rb +10 -10
  50. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Set/MultiSetProxy.rb +1 -1
  51. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Status.rb +1 -1
  52. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Suspend.rb +1 -1
  53. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack.rb +1 -1
  54. data/lib/module-cluster/_private_/ModuleCluster/ExtendForCascade/Subclass.rb +1 -1
  55. data/lib/module-cluster/_private_/ModuleCluster/ExtendForCascade.rb +1 -1
  56. data/lib/module-cluster.rb +14 -2
  57. data/spec/ModuleCluster/Define/Block/CascadingClassOrModule_spec.rb +285 -0
  58. data/spec/ModuleCluster/Define/Block/CascadingClass_spec.rb +241 -0
  59. data/spec/ModuleCluster/Define/Block/CascadingModuleOrSubclass_spec.rb +56 -0
  60. data/spec/ModuleCluster/Define/Block/CascadingModule_spec.rb +278 -0
  61. data/spec/ModuleCluster/Define/Block/ClassOrInstance_spec.rb +13 -13
  62. data/spec/ModuleCluster/Define/Block/ClassOrModuleOrInstance_spec.rb +13 -13
  63. data/spec/ModuleCluster/Define/Block/ClassOrModuleOrSubclass_spec.rb +2 -3
  64. data/spec/ModuleCluster/Define/Block/ClassOrModule_spec.rb +13 -13
  65. data/spec/ModuleCluster/Define/Block/ClassOrSubclass_spec.rb +2 -2
  66. data/spec/ModuleCluster/Define/Block/Class_spec.rb +13 -13
  67. data/spec/ModuleCluster/Define/Block/Instance_spec.rb +5 -5
  68. data/spec/ModuleCluster/Define/Block/ModuleOrInstance_spec.rb +1 -1
  69. data/spec/ModuleCluster/Define/Block/ModuleOrSubclass_spec.rb +2 -4
  70. data/spec/ModuleCluster/Define/Block/Module_spec.rb +13 -13
  71. data/spec/ModuleCluster/Define/Block/Subclass_spec.rb +8 -8
  72. data/spec/ModuleCluster/Define/Block_spec.rb +9 -9
  73. data/spec/ModuleCluster/Define/ClassCluster_spec.rb +227 -227
  74. data/spec/ModuleCluster/Define/ClassOrInstanceCluster_spec.rb +197 -197
  75. data/spec/ModuleCluster/Define/ClusterCascadesToClass_spec.rb +228 -228
  76. data/spec/ModuleCluster/Define/ClusterCascadesToModule_spec.rb +232 -232
  77. data/spec/ModuleCluster/Define/ClusterCascades_spec.rb +224 -224
  78. data/spec/ModuleCluster/Define/Cluster_spec.rb +221 -221
  79. data/spec/ModuleCluster/Define/InstanceCluster_spec.rb +29 -29
  80. data/spec/ModuleCluster/Define/ModuleCluster_spec.rb +227 -227
  81. data/spec/ModuleCluster/Define/ModuleOrClassCluster_spec.rb +227 -227
  82. data/spec/ModuleCluster/Define/ModuleOrInstanceCluster_spec.rb +197 -197
  83. data/spec/ModuleCluster/Suspend/Hooks_spec.rb +120 -120
  84. data/spec/ModuleCluster/Suspend/WithoutHooks_spec.rb +120 -120
  85. data/spec/ModuleCluster_spec.rb +2 -2
  86. data/spec/_private_/ModuleCluster/CascadeFeatures/PerformCascades_spec.rb +192 -192
  87. data/spec/_private_/ModuleCluster/ClusterStack/Set/MultiSetProxy_spec.rb +129 -129
  88. data/spec/_private_/ModuleCluster/ClusterStack/Suspend_spec.rb +17 -17
  89. metadata +9 -1
@@ -1,36 +1,36 @@
1
1
 
2
2
  require_relative '../../../../lib/module-cluster.rb'
3
3
 
4
- describe ModuleCluster::CascadeFeatures::PerformCascades do
4
+ describe ::ModuleCluster::CascadeFeatures::PerformCascades do
5
5
 
6
6
  ##########################################
7
7
  # collect_block_runtime_result_modules #
8
8
  ##########################################
9
9
 
10
10
  it 'can run a block and return any modules that were returned by the block' do
11
- # condition is a ModuleCluster-extended module
12
- module ModuleCluster::CascadeFeatures::PerformCascades::MockCascadeModule01
11
+ # condition is a ::ModuleCluster-extended module
12
+ module ::ModuleCluster::CascadeFeatures::PerformCascades::MockCascadeModule01
13
13
  end
14
14
  # a module to be included/extended at hook time
15
- module ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule01
15
+ module ::ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule01
16
16
  end
17
17
  # another module includes the first module and invokes the runtime hook
18
- module ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule01
18
+ module ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule01
19
19
  end
20
20
  # we need a mock instance to use our methods
21
- module ModuleCluster::CascadeFeatures::PerformCascades::Mock01
21
+ module ::ModuleCluster::CascadeFeatures::PerformCascades::Mock01
22
22
  extend ::ModuleCluster::CascadeFeatures::PerformCascades
23
23
  end
24
- module_self = ModuleCluster::CascadeFeatures::PerformCascades::MockCascadeModule01
25
- hooked_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule01
24
+ module_self = ::ModuleCluster::CascadeFeatures::PerformCascades::MockCascadeModule01
25
+ hooked_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule01
26
26
  block_ran = false
27
- runtime_includes_block = Proc.new { block_ran = true ; ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule01 }
28
- set = ModuleCluster::ClusterStack::Set.new( module_self, :declaration_method, :all, :include, nil, runtime_includes_block )
29
- result_modules = ModuleCluster::CascadeFeatures::PerformCascades::Mock01.collect_block_runtime_result_modules( module_self,
27
+ runtime_includes_block = Proc.new { block_ran = true ; ::ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule01 }
28
+ set = ::ModuleCluster::ClusterStack::Set.new( module_self, :declaration_method, :all, :include, nil, runtime_includes_block )
29
+ result_modules = ::ModuleCluster::CascadeFeatures::PerformCascades::Mock01.collect_block_runtime_result_modules( module_self,
30
30
  hooked_instance,
31
31
  set )
32
32
  block_ran.should == true
33
- result_modules.should == [ ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule01 ]
33
+ result_modules.should == [ ::ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule01 ]
34
34
  end
35
35
 
36
36
  ########################################
@@ -38,126 +38,126 @@ describe ModuleCluster::CascadeFeatures::PerformCascades do
38
38
  ########################################
39
39
 
40
40
  it 'can report whether an instance should be included or extended based on a descriptor symbol' do
41
- module ModuleCluster::CascadeFeatures::PerformCascades::Mock02
41
+ module ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02
42
42
  extend ::ModuleCluster::CascadeFeatures::PerformCascades
43
43
  end
44
- module ModuleCluster::CascadeFeatures::PerformCascades::MockModuleInstance02
44
+ module ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleInstance02
45
45
  end
46
- class ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02
46
+ class ::ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02
47
47
  end
48
48
 
49
49
  module_class_instance_or_all = :all
50
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockModuleInstance02
51
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
52
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02
53
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
54
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02.new
55
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
50
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleInstance02
51
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
52
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02
53
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
54
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02.new
55
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
56
56
  module_class_instance_or_all = :module_class_or_instance
57
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockModuleInstance02
58
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
59
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02
60
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
61
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02.new
62
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
57
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleInstance02
58
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
59
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02
60
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
61
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02.new
62
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
63
63
  module_class_instance_or_all = :module_class_and_instance
64
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockModuleInstance02
65
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
66
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02
67
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
68
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02.new
69
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
64
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleInstance02
65
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
66
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02
67
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
68
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02.new
69
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
70
70
  module_class_instance_or_all = :module_class_instance
71
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockModuleInstance02
72
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
73
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02
74
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
75
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02.new
76
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
71
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleInstance02
72
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
73
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02
74
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
75
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02.new
76
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
77
77
  module_class_instance_or_all = :module_or_class
78
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockModuleInstance02
79
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
80
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02
81
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
82
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02.new
83
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == false
78
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleInstance02
79
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
80
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02
81
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
82
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02.new
83
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == false
84
84
  module_class_instance_or_all = :module_and_class
85
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockModuleInstance02
86
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
87
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02
88
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
89
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02.new
90
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == false
85
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleInstance02
86
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
87
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02
88
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
89
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02.new
90
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == false
91
91
  module_class_instance_or_all = :module_class
92
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockModuleInstance02
93
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
94
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02
95
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
96
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02.new
97
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == false
92
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleInstance02
93
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
94
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02
95
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
96
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02.new
97
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == false
98
98
  module_class_instance_or_all = :module_or_instance
99
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockModuleInstance02
100
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
101
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02
102
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == false
103
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02.new
104
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
99
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleInstance02
100
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
101
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02
102
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == false
103
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02.new
104
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
105
105
  module_class_instance_or_all = :module_and_instance
106
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockModuleInstance02
107
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
108
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02
109
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == false
110
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02.new
111
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
106
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleInstance02
107
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
108
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02
109
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == false
110
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02.new
111
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
112
112
  module_class_instance_or_all = :module_instance
113
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockModuleInstance02
114
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
115
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02
116
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == false
117
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02.new
118
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
113
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleInstance02
114
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
115
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02
116
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == false
117
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02.new
118
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
119
119
  module_class_instance_or_all = :class_or_instance
120
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockModuleInstance02
121
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == false
122
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02
123
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
124
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02.new
125
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
120
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleInstance02
121
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == false
122
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02
123
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
124
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02.new
125
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
126
126
  module_class_instance_or_all = :class_and_instance
127
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockModuleInstance02
128
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == false
129
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02
130
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
131
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02.new
132
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
127
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleInstance02
128
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == false
129
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02
130
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
131
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02.new
132
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
133
133
  module_class_instance_or_all = :class_instance
134
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockModuleInstance02
135
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == false
136
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02
137
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
138
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02.new
139
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
134
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleInstance02
135
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == false
136
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02
137
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
138
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02.new
139
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
140
140
  module_class_instance_or_all = :module
141
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockModuleInstance02
142
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
143
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02
144
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == false
145
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02.new
146
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == false
141
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleInstance02
142
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
143
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02
144
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == false
145
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02.new
146
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == false
147
147
  module_class_instance_or_all = :class
148
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockModuleInstance02
149
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == false
150
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02
151
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
152
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02.new
153
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == false
148
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleInstance02
149
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == false
150
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02
151
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
152
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02.new
153
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == false
154
154
  module_class_instance_or_all = :instance
155
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockModuleInstance02
156
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == false
157
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02
158
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == false
159
- into_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02.new
160
- ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
155
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleInstance02
156
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == false
157
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02
158
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == false
159
+ into_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockClassInstance02.new
160
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock02.should_include_or_extend_instance?( module_class_instance_or_all, into_instance ).should == true
161
161
  end
162
162
 
163
163
  #######################################
@@ -165,53 +165,53 @@ describe ModuleCluster::CascadeFeatures::PerformCascades do
165
165
  #######################################
166
166
 
167
167
  it 'can include or extend the hooked instance as appropriate' do
168
- # condition is a ModuleCluster-extended module
169
- module ModuleCluster::CascadeFeatures::PerformCascades::MockCascadeModule03
168
+ # condition is a ::ModuleCluster-extended module
169
+ module ::ModuleCluster::CascadeFeatures::PerformCascades::MockCascadeModule03
170
170
  end
171
171
  # a module to be included/extended at hook time
172
- module ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule03
172
+ module ::ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule03
173
173
  end
174
174
  # another module includes the first module and invokes the runtime hook
175
- module ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule03A
175
+ module ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule03A
176
176
  end
177
- module ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule03B
177
+ module ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule03B
178
178
  end
179
- module ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule03C
179
+ module ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule03C
180
180
  end
181
181
  # we need a mock instance to use our methods
182
- module ModuleCluster::CascadeFeatures::PerformCascades::Mock03
182
+ module ::ModuleCluster::CascadeFeatures::PerformCascades::Mock03
183
183
  extend ::ModuleCluster::CascadeFeatures::PerformCascades
184
184
  end
185
- module_self = ModuleCluster::CascadeFeatures::PerformCascades::MockCascadeModule03
186
- set = ModuleCluster::ClusterStack::Set.new( module_self, :declaration_method, :all, :include, [ ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule03 ] )
185
+ module_self = ::ModuleCluster::CascadeFeatures::PerformCascades::MockCascadeModule03
186
+ set = ::ModuleCluster::ClusterStack::Set.new( module_self, :declaration_method, :all, :include, [ ::ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule03 ] )
187
187
 
188
188
  # include
189
- ModuleCluster::CascadeFeatures::PerformCascades::Mock03.include_or_extend_hooked_instance( ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule03A,
189
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock03.include_or_extend_hooked_instance( ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule03A,
190
190
  set,
191
191
  true,
192
192
  false,
193
193
  set.modules )
194
- ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule03A.ancestors.include?( ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule03 ).should == true
195
- eigenclass = class << ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule03A ; self ; end
196
- eigenclass.ancestors.include?( ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule03 ).should == false
194
+ ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule03A.ancestors.include?( ::ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule03 ).should == true
195
+ eigenclass = class << ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule03A ; self ; end
196
+ eigenclass.ancestors.include?( ::ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule03 ).should == false
197
197
  # extend
198
- ModuleCluster::CascadeFeatures::PerformCascades::Mock03.include_or_extend_hooked_instance( ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule03B,
198
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock03.include_or_extend_hooked_instance( ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule03B,
199
199
  set,
200
200
  false,
201
201
  true,
202
202
  set.modules )
203
- ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule03B.ancestors.include?( ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule03 ).should == false
204
- eigenclass = class << ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule03B ; self ; end
205
- eigenclass.ancestors.include?( ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule03 ).should == true
203
+ ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule03B.ancestors.include?( ::ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule03 ).should == false
204
+ eigenclass = class << ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule03B ; self ; end
205
+ eigenclass.ancestors.include?( ::ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule03 ).should == true
206
206
  # include and extend
207
- ModuleCluster::CascadeFeatures::PerformCascades::Mock03.include_or_extend_hooked_instance( ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule03C,
207
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock03.include_or_extend_hooked_instance( ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule03C,
208
208
  set,
209
209
  true,
210
210
  true,
211
211
  set.modules )
212
- ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule03C.ancestors.include?( ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule03 ).should == true
213
- eigenclass = class << ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule03C ; self ; end
214
- eigenclass.ancestors.include?( ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule03 ).should == true
212
+ ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule03C.ancestors.include?( ::ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule03 ).should == true
213
+ eigenclass = class << ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule03C ; self ; end
214
+ eigenclass.ancestors.include?( ::ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule03 ).should == true
215
215
 
216
216
  end
217
217
 
@@ -220,8 +220,8 @@ describe ModuleCluster::CascadeFeatures::PerformCascades do
220
220
  ##########################################
221
221
 
222
222
  it 'can cascade modules into the hooked instance as appropriate' do
223
- # condition is a ModuleCluster-extended module
224
- module ModuleCluster::CascadeFeatures::PerformCascades::MockCascadeModule04
223
+ # condition is a ::ModuleCluster-extended module
224
+ module ::ModuleCluster::CascadeFeatures::PerformCascades::MockCascadeModule04
225
225
  def declaration_method( modules )
226
226
  @declaration_method_called = true
227
227
  end
@@ -230,26 +230,26 @@ describe ModuleCluster::CascadeFeatures::PerformCascades do
230
230
  end
231
231
  end
232
232
  # a module to be included/extended at hook time
233
- module ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule04A
233
+ module ::ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule04A
234
234
  end
235
- module ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule04B
235
+ module ::ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule04B
236
236
  end
237
237
  # another module includes the first module and invokes the runtime hook
238
- module ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule04
238
+ module ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule04
239
239
  end
240
240
  # we need a mock instance to use our methods
241
- module ModuleCluster::CascadeFeatures::PerformCascades::Mock04
241
+ module ::ModuleCluster::CascadeFeatures::PerformCascades::Mock04
242
242
  extend ::ModuleCluster::CascadeFeatures::PerformCascades
243
243
  end
244
- module_self = ModuleCluster::CascadeFeatures::PerformCascades::MockCascadeModule04
245
- hooked_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule04
244
+ module_self = ::ModuleCluster::CascadeFeatures::PerformCascades::MockCascadeModule04
245
+ hooked_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule04
246
246
  block_ran = false
247
- runtime_includes_block = Proc.new { block_ran = true ; ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule04B }
248
- set = ModuleCluster::ClusterStack::Set.new( module_self, :declaration_method, :all, :include, [ ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule04A ], runtime_includes_block )
249
- ModuleCluster::CascadeFeatures::PerformCascades::Mock04.cascade_modules_into_hooked_instance( module_self, hooked_instance, set, set.modules )
247
+ runtime_includes_block = Proc.new { block_ran = true ; ::ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule04B }
248
+ set = ::ModuleCluster::ClusterStack::Set.new( module_self, :declaration_method, :all, :include, [ ::ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule04A ], runtime_includes_block )
249
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock04.cascade_modules_into_hooked_instance( module_self, hooked_instance, set, set.modules )
250
250
  # hooked instance should be extended with dependency module (module_self) and :declaration_method should be called on it
251
251
  hooked_instance_eigenclass = class << hooked_instance ; self ; end
252
- hooked_instance_eigenclass.ancestors.include?( ModuleCluster::CascadeFeatures::PerformCascades::MockCascadeModule04 ).should == true
252
+ hooked_instance_eigenclass.ancestors.include?( ::ModuleCluster::CascadeFeatures::PerformCascades::MockCascadeModule04 ).should == true
253
253
  hooked_instance.called_declaration_method.should == true
254
254
  end
255
255
 
@@ -258,52 +258,52 @@ describe ModuleCluster::CascadeFeatures::PerformCascades do
258
258
  ############################
259
259
 
260
260
  it 'can perform include and/or extend of specified modules into instance' do
261
- # condition is a ModuleCluster-extended module
262
- module ModuleCluster::CascadeFeatures::PerformCascades::MockCascadeModule05
261
+ # condition is a ::ModuleCluster-extended module
262
+ module ::ModuleCluster::CascadeFeatures::PerformCascades::MockCascadeModule05
263
263
  end
264
264
  # a module to be included/extended at hook time
265
- module ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule05
265
+ module ::ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule05
266
266
  end
267
267
  # another module includes the first module and invokes the runtime hook
268
- module ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule05A
268
+ module ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule05A
269
269
  end
270
- module ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule05B
270
+ module ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule05B
271
271
  end
272
- module ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule05C
272
+ module ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule05C
273
273
  end
274
274
  # we need a mock instance to use our methods
275
- module ModuleCluster::CascadeFeatures::PerformCascades::Mock05
275
+ module ::ModuleCluster::CascadeFeatures::PerformCascades::Mock05
276
276
  extend ::ModuleCluster::CascadeFeatures::PerformCascades
277
277
  end
278
- module_self = ModuleCluster::CascadeFeatures::PerformCascades::MockCascadeModule05
278
+ module_self = ::ModuleCluster::CascadeFeatures::PerformCascades::MockCascadeModule05
279
279
 
280
280
  # include
281
- set = ModuleCluster::ClusterStack::Set.new( module_self, :declaration_method, :all, :include, [ ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule05 ] )
282
- ModuleCluster::CascadeFeatures::PerformCascades::Mock05.include_extend_modules( ModuleCluster::CascadeFeatures::PerformCascades::MockCascadeModule05,
283
- ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule05A,
281
+ set = ::ModuleCluster::ClusterStack::Set.new( module_self, :declaration_method, :all, :include, [ ::ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule05 ] )
282
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock05.include_extend_modules( ::ModuleCluster::CascadeFeatures::PerformCascades::MockCascadeModule05,
283
+ ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule05A,
284
284
  set,
285
285
  set.modules )
286
- ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule05A.ancestors.include?( ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule05 ).should == true
287
- eigenclass = class << ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule05A ; self ; end
288
- eigenclass.ancestors.include?( ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule05 ).should == false
286
+ ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule05A.ancestors.include?( ::ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule05 ).should == true
287
+ eigenclass = class << ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule05A ; self ; end
288
+ eigenclass.ancestors.include?( ::ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule05 ).should == false
289
289
  # extend
290
- set = ModuleCluster::ClusterStack::Set.new( module_self, :declaration_method, :all, :extend, [ ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule05 ] )
291
- ModuleCluster::CascadeFeatures::PerformCascades::Mock05.include_extend_modules( ModuleCluster::CascadeFeatures::PerformCascades::MockCascadeModule05,
292
- ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule05B,
290
+ set = ::ModuleCluster::ClusterStack::Set.new( module_self, :declaration_method, :all, :extend, [ ::ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule05 ] )
291
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock05.include_extend_modules( ::ModuleCluster::CascadeFeatures::PerformCascades::MockCascadeModule05,
292
+ ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule05B,
293
293
  set,
294
294
  set.modules )
295
- ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule05B.ancestors.include?( ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule05 ).should == false
296
- eigenclass = class << ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule05B ; self ; end
297
- eigenclass.ancestors.include?( ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule05 ).should == true
295
+ ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule05B.ancestors.include?( ::ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule05 ).should == false
296
+ eigenclass = class << ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule05B ; self ; end
297
+ eigenclass.ancestors.include?( ::ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule05 ).should == true
298
298
  # include and extend
299
- set = ModuleCluster::ClusterStack::Set.new( module_self, :declaration_method, :all, :include_and_extend, [ ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule05 ] )
300
- ModuleCluster::CascadeFeatures::PerformCascades::Mock05.include_extend_modules( ModuleCluster::CascadeFeatures::PerformCascades::MockCascadeModule05,
301
- ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule05C,
299
+ set = ::ModuleCluster::ClusterStack::Set.new( module_self, :declaration_method, :all, :include_and_extend, [ ::ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule05 ] )
300
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock05.include_extend_modules( ::ModuleCluster::CascadeFeatures::PerformCascades::MockCascadeModule05,
301
+ ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule05C,
302
302
  set,
303
303
  set.modules )
304
- ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule05C.ancestors.include?( ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule05 ).should == true
305
- eigenclass = class << ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule05C ; self ; end
306
- eigenclass.ancestors.include?( ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule05 ).should == true
304
+ ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule05C.ancestors.include?( ::ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule05 ).should == true
305
+ eigenclass = class << ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule05C ; self ; end
306
+ eigenclass.ancestors.include?( ::ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule05 ).should == true
307
307
 
308
308
  end
309
309
 
@@ -313,8 +313,8 @@ describe ModuleCluster::CascadeFeatures::PerformCascades do
313
313
 
314
314
  it 'can perform cascade of specified modules into instance' do
315
315
 
316
- # condition is a ModuleCluster-extended module
317
- module ModuleCluster::CascadeFeatures::PerformCascades::MockCascadeModule06
316
+ # condition is a ::ModuleCluster-extended module
317
+ module ::ModuleCluster::CascadeFeatures::PerformCascades::MockCascadeModule06
318
318
  def self.should_include_or_extend?( hooked_instance )
319
319
  return true
320
320
  end
@@ -338,45 +338,45 @@ describe ModuleCluster::CascadeFeatures::PerformCascades do
338
338
  end
339
339
  end
340
340
  # a module to be included/extended at hook time
341
- module ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule06A
341
+ module ::ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule06A
342
342
  end
343
- module ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule06B
343
+ module ::ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule06B
344
344
  end
345
- module ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule06C
345
+ module ::ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule06C
346
346
  end
347
347
  # another module includes the first module and invokes the runtime hook
348
- module ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule06
348
+ module ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule06
349
349
  end
350
350
  # we need a mock instance to use our methods
351
- module ModuleCluster::CascadeFeatures::PerformCascades::Mock06
351
+ module ::ModuleCluster::CascadeFeatures::PerformCascades::Mock06
352
352
  extend ::ModuleCluster::CascadeFeatures::PerformCascades
353
353
  end
354
- module_self = ModuleCluster::CascadeFeatures::PerformCascades::MockCascadeModule06
355
- hooked_instance = ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule06
356
- set_one = ModuleCluster::ClusterStack::Set.new( module_self, :declaration_method, :all, :include, [ ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule06A ] )
357
- set_two = ModuleCluster::ClusterStack::Set.new( module_self, :declaration_method, :all, :extend, [ ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule06B ] )
358
- set_three = ModuleCluster::ClusterStack::Set.new( module_self, :declaration_method, :all, :include_and_extend, [ ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule06C ] )
354
+ module_self = ::ModuleCluster::CascadeFeatures::PerformCascades::MockCascadeModule06
355
+ hooked_instance = ::ModuleCluster::CascadeFeatures::PerformCascades::MockModuleIncludingMockCascadeModule06
356
+ set_one = ::ModuleCluster::ClusterStack::Set.new( module_self, :declaration_method, :all, :include, [ ::ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule06A ] )
357
+ set_two = ::ModuleCluster::ClusterStack::Set.new( module_self, :declaration_method, :all, :extend, [ ::ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule06B ] )
358
+ set_three = ::ModuleCluster::ClusterStack::Set.new( module_self, :declaration_method, :all, :include_and_extend, [ ::ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule06C ] )
359
359
  set_stack = [ set_one, set_two, set_three ]
360
360
 
361
361
  # test that suspending works - mocked for true/false
362
362
  module_self.suspend_hooks
363
- ModuleCluster::CascadeFeatures::PerformCascades::Mock06.perform_cascades( module_self, :include, hooked_instance, set_stack )
364
- hooked_instance.ancestors.include?( ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule06A ).should == false
365
- hooked_instance.ancestors.include?( ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule06C ).should == false
363
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock06.perform_cascades( module_self, :include, hooked_instance, set_stack )
364
+ hooked_instance.ancestors.include?( ::ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule06A ).should == false
365
+ hooked_instance.ancestors.include?( ::ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule06C ).should == false
366
366
  eigenclass = class << hooked_instance ; self ; end
367
- eigenclass.ancestors.include?( ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule06B ).should == false
368
- eigenclass.ancestors.include?( ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule06C ).should == false
367
+ eigenclass.ancestors.include?( ::ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule06B ).should == false
368
+ eigenclass.ancestors.include?( ::ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule06C ).should == false
369
369
  # also our dependency module should be extended
370
370
  eigenclass.ancestors.include?( module_self ).should == false
371
371
  module_self.unsuspend_hooks
372
372
 
373
373
 
374
- ModuleCluster::CascadeFeatures::PerformCascades::Mock06.perform_cascades( module_self, :include, hooked_instance, set_stack )
375
- hooked_instance.ancestors.include?( ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule06A ).should == true
376
- hooked_instance.ancestors.include?( ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule06C ).should == true
374
+ ::ModuleCluster::CascadeFeatures::PerformCascades::Mock06.perform_cascades( module_self, :include, hooked_instance, set_stack )
375
+ hooked_instance.ancestors.include?( ::ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule06A ).should == true
376
+ hooked_instance.ancestors.include?( ::ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule06C ).should == true
377
377
  eigenclass = class << hooked_instance ; self ; end
378
- eigenclass.ancestors.include?( ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule06B ).should == true
379
- eigenclass.ancestors.include?( ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule06C ).should == true
378
+ eigenclass.ancestors.include?( ::ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule06B ).should == true
379
+ eigenclass.ancestors.include?( ::ModuleCluster::CascadeFeatures::PerformCascades::MockHookedIncludeModule06C ).should == true
380
380
  # also our dependency module should be extended
381
381
  eigenclass.ancestors.include?( module_self ).should == true
382
382
  hooked_instance.called_declaration_method.should == true