Class: Oktest::SpecLeaf
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#desc ⇒ Object
readonly
Returns the value of attribute desc.
-
#fixture ⇒ Object
readonly
Returns the value of attribute fixture.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#tag ⇒ Object
readonly
Returns the value of attribute tag.
Instance Method Summary collapse
- #-@ ⇒ Object
- #_prefix ⇒ Object
-
#_repr(depth = 0, buf = String.new) ⇒ Object
:nodoc:.
- #accept_visitor(visitor, *args) ⇒ Object
-
#initialize(parent, desc, tag: nil, fixture: nil, location: nil, &block) ⇒ SpecLeaf
constructor
A new instance of SpecLeaf.
- #run_block_in_context_object(context, *args) ⇒ Object
- #unlink_parent ⇒ Object
Constructor Details
#initialize(parent, desc, tag: nil, fixture: nil, location: nil, &block) ⇒ SpecLeaf
Returns a new instance of SpecLeaf.
1130 1131 1132 1133 1134 1135 1136 1137 1138 |
# File 'lib/oktest.rb', line 1130 def initialize(parent, desc, tag: nil, fixture: nil, location: nil, &block) #@parent = parent # not keep parent node to avoid recursive reference @desc = desc @tag = tag @fixture = fixture @location = location # necessary when raising fixture not found error @block = block parent.add_child(self) if parent end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
1140 1141 1142 |
# File 'lib/oktest.rb', line 1140 def block @block end |
#desc ⇒ Object (readonly)
Returns the value of attribute desc.
1140 1141 1142 |
# File 'lib/oktest.rb', line 1140 def desc @desc end |
#fixture ⇒ Object (readonly)
Returns the value of attribute fixture.
1140 1141 1142 |
# File 'lib/oktest.rb', line 1140 def fixture @fixture end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
1140 1141 1142 |
# File 'lib/oktest.rb', line 1140 def location @location end |
#tag ⇒ Object (readonly)
Returns the value of attribute tag.
1140 1141 1142 |
# File 'lib/oktest.rb', line 1140 def tag @tag end |
Instance Method Details
#-@ ⇒ Object
1169 1170 1171 1172 |
# File 'lib/oktest.rb', line 1169 def -@ #; [!bua80] returns self. self end |
#_prefix ⇒ Object
1142 1143 1144 |
# File 'lib/oktest.rb', line 1142 def _prefix '-' end |
#_repr(depth = 0, buf = String.new) ⇒ Object
:nodoc:
1161 1162 1163 1164 1165 1166 1167 |
# File 'lib/oktest.rb', line 1161 def _repr(depth=0, buf=String.new) #:nodoc: #; [!6nsgy] builds debug string. buf << " " * depth << "- #{@desc}" buf << " (tag: #{@tag.inspect})" if @tag buf << "\n" return buf end |
#accept_visitor(visitor, *args) ⇒ Object
1151 1152 1153 1154 |
# File 'lib/oktest.rb', line 1151 def accept_visitor(visitor, *args) #; [!ya32z] invokes 'visit_spec()' method of visitor and returns result of it. return visitor.visit_spec(self, *args) end |
#run_block_in_context_object(context, *args) ⇒ Object
1146 1147 1148 1149 |
# File 'lib/oktest.rb', line 1146 def run_block_in_context_object(context, *args) #; [!tssim] run spec block in text object. context.instance_exec(*args, &@block) end |
#unlink_parent ⇒ Object
1156 1157 1158 1159 |
# File 'lib/oktest.rb', line 1156 def unlink_parent() #; [!e9sv9] do nothing. nil end |