Sha256: 8139fb5bcb9b2f8456fa146a3c61c4be11821e2c16a2ff43ff0e39acaedb91c9

Contents?: true

Size: 786 Bytes

Versions: 1

Compression:

Stored size: 786 Bytes

Contents

class ObjcScenario < Scenario
  def verify_status(results="")
    test_case_name = parent.test_case_name
    #Test Case '-[SayHelloTest testWithABlankObject]' failed (0.001 seconds).
    # ignore "... started."
    results =~ /Test\sCase\s'-\[#{test_case_name}\s#{test_name}\]'\s(passed|failed)/
    match = $1
    if match =~ /failed/
      @passed = false
    elsif match =~ /passed/
      @passed = true
    else
      raise "Can't read results File"
    end
  end
  
  def parse_lines
    lines.map {|l| ObjcStep.new({:body => l}).aggregate!}
  end
  
  def to_s
    <<-END
    -(void) #{test_name}
    {
        #{steps.map {|s| s.to_s}.join(" ")}
    }
    END
  end
  
  def test_name
    "test#{title.remove_invalid_chars.split(/\s+/).map {|w| w.capitalize}.join('')}"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
features-0.3.0 lib/ObjC/objc_scenario.rb