Class: Spinach::Generators::StepGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/spinach/generators/step_generator.rb

Overview

A step generator generates an example output for a step given the parsed feature data.

Instance Method Summary collapse

Constructor Details

#initialize(step) ⇒ StepGenerator

Returns a new instance of StepGenerator.

Parameters:

  • step (Step)

    The step.



9
10
11
# File 'lib/spinach/generators/step_generator.rb', line 9

def initialize(step)
  @step = step
end

Instance Method Details

#generateString

Returns an example step definition.

Returns:

  • (String)

    an example step definition



15
16
17
18
19
20
21
# File 'lib/spinach/generators/step_generator.rb', line 15

def generate
  result = StringIO.new
  result.puts "step '#{Spinach::Support.escape_single_commas @step.name}' do"
  result.puts "  pending 'step not implemented'"
  result.puts "end"
  result.string
end