Method: Minitest::MustWonted::Matcher::Magick#match?

Defined in:
lib/minitest/mustwonted/matcher/magick.rb

#match?(subject, wont) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
15
16
17
18
19
20
21
# File 'lib/minitest/mustwonted/matcher/magick.rb', line 12

def match?(subject, wont)
  @name = 'is_a?' if @name == 'a?' || @name == 'an?'
  match = subject.send @name, *@args

  if wont ? match : !match
    raise Minitest::Assertion, "Expected #{subject.inspect} ##{
      @name} to return: #{ wont ? "false" : "true"
    }\nbut instead have: #{match.inspect}"
  end
end