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.
85 86 87 88 89 90 91 92 |
# File 'lib/spinach/dsl.rb', line 85 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.
108 109 110 |
# File 'lib/spinach/dsl.rb', line 108 def name self.class.feature_name end |
#pending(reason) ⇒ Object
Raises an exception that defines the current step as a pending one.
122 123 124 |
# File 'lib/spinach/dsl.rb', line 122 def pending(reason) raise Spinach::StepPendingException.new(reason) end |
#step_location_for(step) ⇒ String
Gets current step source location.
101 102 103 104 |
# File 'lib/spinach/dsl.rb', line 101 def step_location_for(step) underscored_step = Spinach::Support.underscore(step) location = method(underscored_step).source_location if self.respond_to?(underscored_step) end |