class Cucumberator::Commands::Next

Public Class Methods

new(scenario, step_line) click to toggle source
# File lib/cucumberator/commands/next.rb, line 9
def initialize(scenario, step_line)
  @scenario, @step_line = scenario, step_line
  @steps = Cucumberator::Steps.new(@scenario)
end
perform(scenario, step_line, *args, &block) click to toggle source
# File lib/cucumberator/commands/next.rb, line 4
def perform(scenario, step_line, *args, &block)
  new(scenario, step_line).next_step
end

Public Instance Methods

detect_next_step() click to toggle source
# File lib/cucumberator/commands/next.rb, line 26
def detect_next_step
  next_step = nil

  @scenario.steps.each do |step|
    if step.status == :skipped and not step.backtrace_line["Then I will write new steps"]
      next_step = step
      break
    end
  end

  next_step
end
next_step() click to toggle source
# File lib/cucumberator/commands/next.rb, line 14
def next_step
  if next_step = detect_next_step
    puts next_step.backtrace_line
    @steps.current_visitor.visit_step(next_step)
    @step_line.set(next_step.file_colon_line.split(':').last.to_i)
    false
  else
    puts ":: Looks like it's the end of feature file. Happy coding! <3"
    true
  end
end