module Shoulda::Matchers::Independent
def delegate_method(delegating_method)
it { should delegate_method(:deliver_mail).to(:mailman).with_arguments('221B Baker St.', :hastily => true)
it { should delegate_method(:deliver_mail).to(:mailman).as(:deliver_with_haste)
Examples:
* :with_arguments - tests that the method on the object being delegated to is called with certain arguments
* :as - tests that the object being delegated to is called with a certain method (defaults to same name as delegating method)
Options:
it { should delegate_method(:deliver_mail).to(:mailman) }
Basic Syntax:
Ensure that a given method is delegated properly.
def delegate_method(delegating_method) DelegateMatcher.new(delegating_method) end