Class: DTest::Global::Manager
- Inherits:
-
Object
- Object
- DTest::Global::Manager
- Includes:
- Singleton
- Defined in:
- lib/dtest/global.rb
Overview
class Harness
Instance Attribute Summary collapse
-
#defined ⇒ Object
Returns the value of attribute defined.
-
#harness ⇒ Object
Returns the value of attribute harness.
Instance Method Summary collapse
- #after(option = {}, &block) ⇒ Object
- #before(option = {}, &block) ⇒ Object
- #clear ⇒ Object
- #include_context(name) ⇒ Object
-
#initialize ⇒ Manager
constructor
A new instance of Manager.
Methods included from Singleton
Constructor Details
#initialize ⇒ Manager
Returns a new instance of Manager.
87 88 89 |
# File 'lib/dtest/global.rb', line 87 def initialize clear end |
Instance Attribute Details
#defined ⇒ Object
Returns the value of attribute defined.
85 86 87 |
# File 'lib/dtest/global.rb', line 85 def defined @defined end |
#harness ⇒ Object
Returns the value of attribute harness.
84 85 86 |
# File 'lib/dtest/global.rb', line 84 def harness @harness end |
Instance Method Details
#after(option = {}, &block) ⇒ Object
111 112 113 114 115 |
# File 'lib/dtest/global.rb', line 111 def after(option = {}, &block) b = Block.new("after", option, &block) b.parent = 'Global' @harness.after << b end |
#before(option = {}, &block) ⇒ Object
105 106 107 108 109 |
# File 'lib/dtest/global.rb', line 105 def before(option = {}, &block) b = Block.new("before", option, &block) b.parent = 'Global' @harness.before << b end |
#clear ⇒ Object
91 92 93 94 95 |
# File 'lib/dtest/global.rb', line 91 def clear remove_instance_var @harness = Harness.new @defined = false end |
#include_context(name) ⇒ Object
97 98 99 100 101 102 103 |
# File 'lib/dtest/global.rb', line 97 def include_context(name) if DTest::SharedContext::Manager::instance.has_key?(name) @harness.shared_contexts << name unless @harness.shared_contexts.include?(name) else raise "#{name} context is not defined" end end |