module Rspec::Something

Constants

VERSION

Public Instance Methods

something() click to toggle source

Return something should receive a message.

This

UserMailer.should_receive(:hello).and_return something.deliver

is same as

mail = double
mail.should_receive :deliver
UserMailer.should_receive(:hello).and_return mail

To assert that the message won’t be received, insert ‘won_t` like:

something.won_t.deliver
# File lib/rspec/something.rb, line 28
def something
  Rspec::Something::Proxy.new(double)
end