Class: Spinach::Generators::StepGenerator
- Inherits:
-
Object
- Object
- Spinach::Generators::StepGenerator
- 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
-
#generate ⇒ String
An example step definition.
-
#initialize(step) ⇒ StepGenerator
constructor
A new instance of StepGenerator.
Constructor Details
#initialize(step) ⇒ StepGenerator
Returns a new instance of StepGenerator.
9 10 11 |
# File 'lib/spinach/generators/step_generator.rb', line 9 def initialize(step) @step = step end |
Instance Method Details
#generate ⇒ String
Returns 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 |