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

#execute_step(step) ⇒ String

Executes a given step.

Parameters:

  • step (String)

    The step name to execute.

Returns:

  • (String)

    The file and line where the step was defined.



86
87
88
89
90
91
92
93
94
95
96
# File 'lib/spinach/dsl.rb', line 86

def execute_step(step)
  step = Spinach::Support.underscore(step)
  location = nil
  if self.respond_to?(step)
    location = method(step).source_location
    self.send(step)
  else
    raise Spinach::StepNotDefinedException.new(self, step)
  end
  location
end

#nameString

Returns The feature name.

Returns:

  • (String)

    The feature name.



100
101
102
# File 'lib/spinach/dsl.rb', line 100

def name
  self.class.feature_name
end