class Totes::Matcher::BeAnything

Public Class Methods

new(method_name, *args, &block) click to toggle source
# File lib/totes/matcher/be_anything.rb, line 6
def initialize(method_name, *args, &block)
  @method = method_name =~ /\?$/ ? method_name : "#{method_name}?"
  @args   = args
  @block  = block
end

Public Instance Methods

likes(subject) click to toggle source
# File lib/totes/matcher/be_anything.rb, line 12
def likes(subject)
  @result = subject.__send__ @method, *@args, &@block
end