module Cucumber::Core::Test::Result

Constants

STRICT_AFFECTED_TYPES
TYPES

Public Class Methods

ok?(type, be_strict = StrictConfiguration.new) click to toggle source
# File lib/cucumber/core/test/result.rb, line 13
def self.ok?(type, be_strict = StrictConfiguration.new)
  class_name = type.to_s.slice(0, 1).capitalize + type.to_s.slice(1..-1)
  const_get(class_name).ok?(be_strict.strict?(type))
end
query_methods(result_type) click to toggle source

Defines to_sym on a result class for the given result type

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

# File lib/cucumber/core/test/result.rb, line 22
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