Class: Matchi::Matchers::BeNil::Matcher

Inherits:
Object
  • Object
show all
Includes:
Matchi::MatchersBase
Defined in:
lib/matchi/matchers/be_nil.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 nil?

be_nil = Matchi::Matchers::BeNil::Matcher.new
be_nil.matches? { nil } # => true

Yield Returns:

  • (#object_id)

    the actual value to compare to the expected one.

Returns:

  • (Boolean)

    Comparison between actual and expected values.



24
25
26
# File 'lib/matchi/matchers/be_nil.rb', line 24

def matches?
  nil.equal?(yield)
end