module Cucumber::Core::Test::Result

def self.ok?(type, strict: StrictConfiguration.new)

def self.ok?(type, strict: StrictConfiguration.new)
  class_name = type.to_s.slice(0, 1).capitalize + type.to_s.slice(1..-1)
  const_get(class_name).ok?(strict: strict.strict?(type))
end

def self.query_methods(result_type)

Defines predicate methods on a result class with only the given one returning true

Defines to_sym on a result class for the given result type
def self.query_methods(result_type)
  Module.new do
    define_method :to_sym do
      result_type
    end
    TYPES.each do |possible_result_type|
      define_method("#{possible_result_type}?") do
        possible_result_type == to_sym
      end
    end
  end
end