Module: Test::TAP::TestSuite

Included in:
PHPUnit::TestSuite
Defined in:
lib/test/tap/test_suite.rb

Instance Method Summary collapse

Instance Method Details

#run(result) {|Test::Unit::TestSuite::STARTED, ''| ... } ⇒ Object

Yields:

  • (Test::Unit::TestSuite::STARTED, '')


7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/test/tap/test_suite.rb', line 7

def run(result, &progress_block)
  yield(Test::Unit::TestSuite::STARTED, '')
  phpunit = IO.popen shell_cmd
  while line = phpunit.gets
    if line =~ /\ATAP version \d+\Z/ || line =~ /\A1..\d+\Z/
      next
    elsif line =~ /\A\s*---\Z/
      yaml_content = line
      yaml_content += line until (line=phpunit.gets) =~ /\A\s*\.\.\.\Z/
      @current_case.parse_details yaml_content
    else
      @current_case.run(result, &progress_block) if ! @current_case.nil?
      @current_case = TestCase.new(line)
    end
  end
  @current_case.run(result, &progress_block)
  yield(Test::Unit::TestSuite::FINISHED, '')
end

#sizeObject



26
27
28
29
# File 'lib/test/tap/test_suite.rb', line 26

def size
  # We can't give an accurate count without running phpunit, so punt
  1
end