# File lib/rspec/mocks/targets.rb, line 11 def self.delegate_to(matcher_method, options = {}) method_name = options.fetch(:from) { :to } class_eval("def \#{method_name}(matcher, &block)\nunless Matchers::Receive === matcher\nraise UnsupportedMatcherError, \"only the `receive` matcher is supported \" +\n\"with `\\\#{expression}(...).\\\#{\#{method_name.inspect}}`, but you have provided: \\\#{matcher}\"\nend\n\nmatcher.__send__(\#{matcher_method.inspect}, @target, &block)\nend\n") end