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