Class: Matchi::Matchers::BeTrue::Matcher

Inherits:
Object
  • Object
show all
Includes:
Matchi::MatchersBase
Defined in:
lib/matchi/matchers/be_true.rb

Overview

The matcher.

Instance Method Summary collapse

Methods included from Matchi::MatchersBase

#to_h, #to_s

Instance Method Details

#matches?Boolean

Boolean comparison between the actual value and the expected value.

Examples:

Is it true?

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



22
23
24
# File 'lib/matchi/matchers/be_true.rb', line 22

def matches?
  true.equal?(yield)
end