Class: Matchi::BeNil

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

Overview

Nil matcher.

Instance Method Summary collapse

Instance Method Details

#matches?Boolean

Returns Comparison between actual and expected values.

Examples:

Is it nil?

be_nil = Matchi::BeNil.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.



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

def matches?
  nil.equal?(yield)
end