Module: Spinach::DSL::InstanceMethods
- Defined in:
- lib/spinach/dsl.rb
Overview
Instance methods to include in the host class.
Instance Method Summary collapse
-
#execute(step) ⇒ Object
Executes a given step.
-
#name ⇒ String
The feature name.
-
#step_location_for(step) ⇒ String
Gets current step source location.
Instance Method Details
#execute(step) ⇒ Object
Executes a given step.
69 70 71 72 73 74 75 76 |
# File 'lib/spinach/dsl.rb', line 69 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 |
#name ⇒ String
Returns The feature name.
92 93 94 |
# File 'lib/spinach/dsl.rb', line 92 def name self.class.feature_name end |
#step_location_for(step) ⇒ String
Gets current step source location.
85 86 87 88 |
# File 'lib/spinach/dsl.rb', line 85 def step_location_for(step) underscored_step = Spinach::Support.underscore(step) location = method(underscored_step).source_location if self.respond_to?(underscored_step) end |