Sha256: 3d4648bb5795a0237549e5417c27e24cad70921021018b2875bed02a3078a80e

Contents?: true

Size: 635 Bytes

Versions: 1

Compression:

Stored size: 635 Bytes

Contents

require 'test/tap/test_suite'
require 'test/unit'

module Test
  module PHPUnit

    def phpunit(file, opts={})
      (class << self; self end).instance_eval do
        define_method :suite do
          Test::PHPUnit::TestSuite.new file, opts
        end
      end
    end

    class TestSuite < Test::Unit::TestSuite
      include Test::TAP::TestSuite

      def initialize(php_file, opts={})
        @php_file = php_file
        @php_opt_string = opts.collect { |k,v| "--#{k} '#{v}'" }.join " "
        super 'Dummy'
      end

      def shell_cmd
        "phpunit --tap #{@php_opt_string} #{@php_file}"
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tap_out-0.0.2 lib/test/phpunit.rb