Module: Cucumber::Core::Test::Result

Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-core-11.0.0/lib/cucumber/core/test/result.rb

Defined Under Namespace

Classes: Duration, Failed, Flaky, Passed, Pending, Raisable, Skipped, StrictConfiguration, Summary, Undefined, Unknown, UnknownDuration

Constant Summary collapse

TYPES =
[:failed, :flaky, :skipped, :undefined, :pending, :passed, :unknown].freeze
STRICT_AFFECTED_TYPES =
[:flaky, :undefined, :pending].freeze

Class Method Summary collapse

Class Method Details

.ok?(type, be_strict = StrictConfiguration.new) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
16
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-core-11.0.0/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) ⇒ Object

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



22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-core-11.0.0/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