Module: Spinach::DSL::InstanceMethods
- Defined in:
- lib/spinach/dsl.rb
Overview
Instance methods to include in the host class.
Instance Method Summary (collapse)
-
- (Object) execute(step)
Executes a given step.
-
- (String) name
The feature name.
-
- (Object) pending(reason)
Raises an exception that defines the current step as a pending one.
-
- (String) step_location_for(step)
Gets current step source location.
Instance Method Details
- (Object) execute(step)
Executes a given step.
167 168 169 170 171 172 173 174 |
# File 'lib/spinach/dsl.rb', line 167 def execute(step) underscored_step = Spinach::Support.underscore(step.name) if self.respond_to?(underscored_step) self.send(underscored_step) else raise Spinach::StepNotDefinedException.new(step) end end |
- (String) name
The feature name.
190 191 192 |
# File 'lib/spinach/dsl.rb', line 190 def name self.class.feature_name end |
- (Object) pending(reason)
Raises an exception that defines the current step as a pending one.
204 205 206 |
# File 'lib/spinach/dsl.rb', line 204 def pending(reason) raise Spinach::StepPendingException.new(reason) end |
- (String) step_location_for(step)
Gets current step source location.
183 184 185 186 |
# File 'lib/spinach/dsl.rb', line 183 def step_location_for(step) underscored_step = Spinach::Support.underscore(step) location = method(underscored_step).source_location if self.respond_to?(underscored_step) end |