Sha256: 6a135ef0c57649685969321da64a4068c94bece194964595ba2054443ef13824

Contents?: true

Size: 788 Bytes

Versions: 2

Compression:

Stored size: 788 Bytes

Contents

# frozen_string_literal: true

require_relative File.join('..', 'matchers_base') unless
  defined?(::Matchi::MatchersBase)

module Matchi
  module Matchers
    # **Untruth** matcher.
    module BeFalse
      # The matcher.
      class Matcher
        include MatchersBase

        # Boolean comparison between the actual value and the expected value.
        #
        # @example Is it false?
        #   be_false = Matchi::Matchers::BeFalse::Matcher.new
        #   be_false.matches? { false } # => true
        #
        # @yieldreturn [#object_id] the actual value to compare to the expected
        #   one.
        #
        # @return [Boolean] Comparison between actual and expected values.
        def matches?
          false.equal?(yield)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
matchi-1.0.4 lib/matchi/matchers/be_false.rb
matchi-1.0.3 lib/matchi/matchers/be_false.rb