Class: Matchi::BeTrue

Inherits:
BasicObject
Defined in:
lib/matchi/be_true.rb

Overview

Truth matcher.

Instance Method Summary collapse

Instance Method Details

#matches?Boolean

Returns Comparison between actual and expected values.

Examples:

Is it true?

be_true = Matchi::BeTrue.new
be_true.matches? { true } # => true

Yield Returns:

  • (#object_id)

    the actual value to compare to the expected one.

Returns:

  • (Boolean)

    Comparison between actual and expected values.



11
12
13
# File 'lib/matchi/be_true.rb', line 11

def matches?
  true.equal?(yield)
end