class Judges::Categories
def ok?(cats)
- Example: Check if a test with categories should run -
Returns:
-
(Boolean)
- true if the test should be executed, false otherwise
Parameters:
-
cats
(Array
) -- List of categories associated with the test,, String, nil
def ok?(cats) cats = [] if cats.nil? cats = [cats] unless cats.is_a?(Array) cats.each do |c| return false if @disable.any?(c) return true if @enable.any?(c) end return true if @enable.empty? false end