Sha256: 73a0349d03b8aeca7639d56ca8d9f947c5eb0ef5e08ed8c37eb5a008490a6340

Contents?: true

Size: 564 Bytes

Versions: 1

Compression:

Stored size: 564 Bytes

Contents

# frozen_string_literal: true

require_relative 'base'

module Spectus
  module RequirementLevel
    # Low requirement level's class.
    #
    # @api private
    #
    class Low < Base
      # Evaluate the expectation.
      #
      # @return [Result::Fail, Result::Pass] Report if the low expectation
      #   pass or fail.
      def result(isolation = false)
        state = sandbox(isolation)

        if state.valid? || state.exception.is_a?(::NoMethodError)
          pass!(state)
        else
          fail!(state)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
spectus-3.0.10 lib/spectus/requirement_level/low.rb