Sha256: 6b8fbaea6299ded5982ba4b9429c3d6ef2bf9b9e0a5ebb2750f8e6376b00ba6b

Contents?: true

Size: 931 Bytes

Versions: 1

Compression:

Stored size: 931 Bytes

Contents

require 'test/tap/test_case'

module Test
  module TAP
    module TestSuite

      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.present?
            @current_case = TestCase.new(line)
          end
        end
        @current_case.run(result, &progress_block)
        yield(Test::Unit::TestSuite::FINISHED, '')
      end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tap_out-0.0.1 lib/test/tap/test_suite.rb