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.
-
#pending(reason) ⇒ Object
Raises an exception that defines the current step as a pending one.
-
#step_location_for(step) ⇒ String
Gets current step source location.
Instance Method Details
#execute(step) ⇒ Object
Executes a given step.
172 173 174 175 176 177 178 179 |
# File 'lib/spinach/dsl.rb', line 172 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.
195 196 197 |
# File 'lib/spinach/dsl.rb', line 195 def name self.class.feature_name end |
#pending(reason) ⇒ Object
Raises an exception that defines the current step as a pending one.
209 210 211 |
# File 'lib/spinach/dsl.rb', line 209 def pending(reason) raise Spinach::StepPendingException.new(reason) end |
#step_location_for(step) ⇒ String
Gets current step source location.
188 189 190 191 |
# File 'lib/spinach/dsl.rb', line 188 def step_location_for(step) underscored_step = Spinach::Support.underscore(step) location = method(underscored_step).source_location if self.respond_to?(underscored_step) end |