Class: Mocktail::Matchers::Matches

Inherits:
Base
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/mocktail/matchers/matches.rb,
lib/mocktail/sorbet/mocktail/matchers/matches.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#initialize, #inspect, #is_mocktail_matcher?

Constructor Details

This class inherits a constructor from Mocktail::Matchers::Base

Class Method Details

.matcher_nameObject



5
6
7
# File 'lib/mocktail/matchers/matches.rb', line 5

def self.matcher_name
  :matches
end

Instance Method Details

#match?(actual) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
12
13
# File 'lib/mocktail/matchers/matches.rb', line 9

def match?(actual)
  actual.respond_to?(:match?) && actual.match?(@expected)
rescue
  false
end