class Cucumber::Ast::Scenario

Public Instance Methods

steps_as_string() click to toggle source

return the steps and as strings ready to write to the testcase

# File lib/cucumber_testrail/reopen_scenario.rb, line 8
def steps_as_string
  to_sexp.select{|a| a[0]==:step_invocation}.map do |s|
    if s[4]
      ["#{s[2]}#{s[3]}"]+s[4].select{|e| e.is_a?(Array) && e[0]==:row}.map do |l|
        "| #{l.select{|e| e.is_a?(Array)}.map{|e| e[1]}.join(' | ')} |"
      end
    else  
      "#{s[2]}#{s[3]}"
    end
  end.flatten.join("\n")
end
tag_line() click to toggle source
# File lib/cucumber_testrail/reopen_scenario.rb, line 20
def tag_line
  line - 2
end