Sha256: ccd0bf2bccc0c51d5ed76ee6f8dce1546ec066a56af2d3be87942b4c40a25f0b

Contents?: true

Size: 748 Bytes

Versions: 2

Compression:

Stored size: 748 Bytes

Contents

class ObjcScenario < Scenario
  def verify_status(results="")
    test_case_name = parent.test_case_name
    #Test Case '-[SayHelloTest testWithABlankObject]' failed (0.001 seconds).
    results =~ /Test\sCase\s'-\[#{test_case_name}\s#{test_name}\]'\s(\w+)/
    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

2 entries across 2 versions & 1 rubygems

Version Path
features-0.2.1 lib/ObjC/objc_scenario.rb
features-0.2.0 lib/ObjC/objc_scenario.rb