class MotionSpec::Matcher::HaveGeneric

Public Class Methods

new(method_name, *args) click to toggle source
# File lib/motion-spec/matcher/have_generic.rb, line 4
def initialize(method_name, *args)
  @method_name = method_name
  @args = args
end

Public Instance Methods

fail!(subject, negated) click to toggle source
# File lib/motion-spec/matcher/have_generic.rb, line 13
def fail!(subject, negated)
  fail FailedExpectation.new(
    FailMessageRenderer.message_for_have_generic(
      negated, subject, @method_name, @args
    )
  )
end
matches?(subject) click to toggle source
# File lib/motion-spec/matcher/have_generic.rb, line 9
def matches?(subject)
  subject.send("has_#{@method_name}?", *@args)
end