Sha256: 430eb52fa47ce70eeb6b97dc720820e8c89a43152f16f66b2bc9ea86ff28208c

Contents?: true

Size: 748 Bytes

Versions: 3

Compression:

Stored size: 748 Bytes

Contents

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

module Matchi
  module Matchers
    # **Truth** matcher.
    module BeTrue
      # The matcher.
      class Matcher
        include MatchersBase

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
matchi-1.0.2 lib/matchi/matchers/be_true.rb
matchi-1.0.1 lib/matchi/matchers/be_true.rb
matchi-1.0.0 lib/matchi/matchers/be_true.rb