Sha256: 912450db483aa1636190269a19769716d25fdd781d67a09cba76b57d78af46bc

Contents?: true

Size: 766 Bytes

Versions: 42

Compression:

Stored size: 766 Bytes

Contents

module Test
  module Unit
    module Collector
      def initialize
        @filters = []
      end

      def filter=(filters)
        @filters = case(filters)
          when Proc
            [filters]
          when Array
            filters
        end
      end

      def add_suite(destination, suite)
        to_delete = suite.tests.find_all{|t| !include?(t)}
        to_delete.each{|t| suite.delete(t)}
        destination << suite unless(suite.size == 0)
      end

      def include?(test)
        return true if(@filters.empty?)
        @filters.each do |filter|
          return false if filter[test] == false
        end
        true
      end

      def sort(suites)
        suites.sort_by {|suite| suite.name || suite.to_s}
      end
    end
  end
end

Version data entries

42 entries across 42 versions & 6 rubygems

Version Path
activegroonga-1.0.4 test-unit/lib/test/unit/collector.rb
rroonga-1.2.0 test-unit/lib/test/unit/collector.rb
rroonga-1.1.0 test-unit/lib/test/unit/collector.rb
glib2-0.90.7-x86-mingw32 test-unit/lib/test/unit/collector.rb
glib2-0.90.7 test-unit/lib/test/unit/collector.rb
glib2-0.90.6 test-unit/lib/test/unit/collector.rb
glib2-0.90.6-x86-mingw32 test-unit/lib/test/unit/collector.rb
rroonga-1.0.9 test-unit/lib/test/unit/collector.rb
rroonga-1.0.8 test-unit/lib/test/unit/collector.rb
activegroonga-1.0.3 test-unit/lib/test/unit/collector.rb
rroonga-1.0.7 test-unit/lib/test/unit/collector.rb
activegroonga-1.0.1 test-unit/lib/test/unit/collector.rb
rroonga-1.0.5 test-unit/lib/test/unit/collector.rb
activegroonga-1.0.0 test-unit/lib/test/unit/collector.rb
rroonga-1.0.4 test-unit/lib/test/unit/collector.rb
rroonga-1.0.3 test-unit/lib/test/unit/collector.rb
test-unit-2.1.2 lib/test/unit/collector.rb
rroonga-1.0.2 test-unit/lib/test/unit/collector.rb
glib2-0.90.5 test-unit/lib/test/unit/collector.rb
glib2-0.90.5-x86-mingw32 test-unit/lib/test/unit/collector.rb