Module: Rspec::Something

Defined in:
lib/rspec/something.rb,
lib/rspec/something/proxy.rb,
lib/rspec/something/version.rb

Defined Under Namespace

Classes: Proxy

Constant Summary collapse

VERSION =
"0.0.2"

Instance Method Summary collapse

Instance Method Details

#somethingObject

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


28
29
30
# File 'lib/rspec/something.rb', line 28

def something
  Rspec::Something::Proxy.new(double)
end