Module: Spinach::DSL::InstanceMethods

Defined in:
lib/spinach/dsl.rb

Overview

Instance methods to include in the host class.

Instance Method Summary (collapse)

Instance Method Details

- (Object) execute(step)

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

- (String) name



195
196
197
# File 'lib/spinach/dsl.rb', line 195

def name
  self.class.feature_name
end

- (Object) pending(reason)

Raises an exception that defines the current step as a pending one.

Raises:



209
210
211
# File 'lib/spinach/dsl.rb', line 209

def pending(reason)
  raise Spinach::StepPendingException.new(reason)
end

- (String) step_location_for(step)

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