class Lucid::AST::StepInvocations

Public Class Methods

new(steps) click to toggle source
# File lib/lucid/ast/step_invocations.rb, line 6
def initialize(steps)
  @steps = steps
  @steps.each do |step|
    step.step_collection = self
  end
end

Public Instance Methods

+(step_invocations) click to toggle source
# File lib/lucid/ast/step_invocations.rb, line 34
def +(step_invocations)
  dup(step_invocations)
end
accept(visitor) click to toggle source
# File lib/lucid/ast/step_invocations.rb, line 13
def accept(visitor)
  visitor.visit_steps(self) do
    @steps.each do |step|
      step.accept(visitor)
    end
  end
end
dup(step_invocations = []) click to toggle source

Duplicates this instance and adds step_invocations to the end

# File lib/lucid/ast/step_invocations.rb, line 39
def dup(step_invocations = [])
  StepInvocations.new(@steps + step_invocations)
end
each(&proc) click to toggle source
# File lib/lucid/ast/step_invocations.rb, line 21
def each(&proc)
  @steps.each(&proc)
end
exception() click to toggle source
# File lib/lucid/ast/step_invocations.rb, line 43
def exception
  @exception ||= ((failed = @steps.detect {|step| step.exception}) && failed.exception)
end
failed?() click to toggle source
# File lib/lucid/ast/step_invocations.rb, line 54
def failed?
  status == :failed
end
length() click to toggle source
# File lib/lucid/ast/step_invocations.rb, line 63
def length
  @steps.length
end
max_line_length(feature_element) click to toggle source
# File lib/lucid/ast/step_invocations.rb, line 25
def max_line_length(feature_element)
  lengths = (@steps + [feature_element]).map{|e| e.text_length}
  lengths.max
end
previous_step(step) click to toggle source
# File lib/lucid/ast/step_invocations.rb, line 58
def previous_step(step)
  i = @steps.index(step) || -1
  @steps[i-1]
end
skip_invoke!() click to toggle source
# File lib/lucid/ast/step_invocations.rb, line 30
def skip_invoke!
  @steps.each{ |step_invocation| step_invocation.skip_invoke! }
end
status() click to toggle source
# File lib/lucid/ast/step_invocations.rb, line 47
def status
  @steps.each do |step_invocation|
    return step_invocation.status if step_invocation.status != :passed
  end
  :passed
end
to_sexp() click to toggle source
# File lib/lucid/ast/step_invocations.rb, line 67
def to_sexp
  @steps.map{|step| step.to_sexp}
end