Sha256: e549294ff84d7f669e78b434126a2dcf91cb5ca53f3f8c28a10f9ee854b93732

Contents?: true

Size: 756 Bytes

Versions: 41

Compression:

Stored size: 756 Bytes

Contents

module Bozo::TestRunners

  class Runit

    def initialize
      @paths = []
    end

    def path(path)
      @paths << path
    end

    def execute
      require 'test/unit'
      
      test_files = []

      @paths.each do |p|
        Dir[p].select {|f| (File.extname f) == '.rb'}.each {|f| test_files << f}
      end

      # raise an error if no test files were found. This may indicate a configuration issue
      raise Bozo::ConfigurationError.new "No tests found" unless test_files.any?
      raise Bozo::ExecutionError.new(:runit, test_files, -1) unless execute_tests test_files
    end

    private

    def execute_tests(test_files)
      Test::Unit::AutoRunner.run(true, nil, test_files)
    end

  end

end

Version data entries

41 entries across 41 versions & 2 rubygems

Version Path
bozo-scripts-0.18.5 lib/bozo/test_runners/runit.rb
bozo-scripts-0.18.4 lib/bozo/test_runners/runit.rb
bozo-scripts-0.18.3 lib/bozo/test_runners/runit.rb
bozo-scripts-0.18.2 lib/bozo/test_runners/runit.rb
bozo-scripts-0.18.1 lib/bozo/test_runners/runit.rb
bozo-scripts-0.18.0 lib/bozo/test_runners/runit.rb
bozo-scripts-0.17.0 lib/bozo/test_runners/runit.rb
bozo-scripts-0.16.3 lib/bozo/test_runners/runit.rb
bozo-scripts-0.16.2 lib/bozo/test_runners/runit.rb
bozo-scripts-0.16.1 lib/bozo/test_runners/runit.rb
bozo-scripts-0.16.0 lib/bozo/test_runners/runit.rb
bozo-scripts-0.15.0 lib/bozo/test_runners/runit.rb
bozo-scripts-0.14.0 lib/bozo/test_runners/runit.rb
bozo-scripts-0.13.0 lib/bozo/test_runners/runit.rb
bozo-scripts-0.12.0 lib/bozo/test_runners/runit.rb
bozo-scripts-0.11.0 lib/bozo/test_runners/runit.rb
bozo-scripts-0.10.6 lib/bozo/test_runners/runit.rb
bozo-scripts-0.10.5 lib/bozo/test_runners/runit.rb
bozo-scripts-0.10.4 lib/bozo/test_runners/runit.rb
bozo-scripts-0.10.3 lib/bozo/test_runners/runit.rb