Class: Matchi::Matcher::BeTrue

Inherits:
Base
  • Object
show all
Defined in:
lib/matchi/matcher/be_true.rb

Overview

Truth matcher.

Instance Attribute Summary

Attributes inherited from Base

#expected

Instance Method Summary collapse

Methods inherited from Base

#inspect, #to_s, to_sym

Instance Method Details

#matches?Boolean

Boolean comparison between the actual value and the expected value.

Examples:

Is it true?

be_true = Matchi::Matcher::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.



19
20
21
# File 'lib/matchi/matcher/be_true.rb', line 19

def matches?(*, **)
  true.equal?(yield)
end