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.



75
76
77
78
79
80
81
82
83
84
85
# File 'lib/spinach/dsl.rb', line 75

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

#nameString

Returns The feature name.

Returns:

  • (String)

    The feature name.



89
90
91
# File 'lib/spinach/dsl.rb', line 89

def name
  self.class.feature_name
end