Patches: Browse | Submit New | Admin

[#15235] Provide a pseudo-call syntax for simplifying set-up of expectations and stubs

Date:
2007-10-31 14:59
Priority:
3
Submitted By:
Steve Purcell (purcell)
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
Provide a pseudo-call syntax for simplifying set-up of expectations and stubs

Detailed description
This small patch with tests essentially implements feature request #10412, which allows for a nice alternate syntax
for setting up expectations and stubs.  Using this syntax, the following lines are equivalent

mock.expects(:some_method).with(1,2,"three")
mock.expects.some_method(1,2,"three")

(The same goes for mock.stubs)

The Rubyforge tracker wouldn't let me attach my patch to ticket #10412, hence this new tracker item.

-Steve

Add A Comment: Notepad

Please login


Followup

Message
Date: 2009-01-02 16:53
Sender: James Mead

This patch has moved to Lighthouse [1].

[1] http://floehopper.lighthouseapp.com/projects/22289/tickets/4
Date: 2007-11-05 10:21
Sender: Steve Purcell

James: For some reason my trimmed patch didn't get uploaded when
I made the
prior comment; here it is.  I personally think it's not particularly
invasive, but I'm
glad you're the ultimate arbiter of good taste.
Date: 2007-11-05 10:07
Sender: James Mead

Hi Steve,

I've responded over on the feature request...

http://rubyforge.org/tracker/index.php?func=detail&aid=10412&
amp;group_id=1917&atid=7480

Cheers, James.
http://blog.floehopper.org
Date: 2007-11-03 13:22
Sender: Steve Purcell

Here's an updated version of the patch which omits changes to
the trailing white
space present in the svn version of the file.

Attached Files:

Name Description Download
mocha-pseudo-call.patch Download
mocha-pseudo-call.1.patch Download

Changes:

Field Old Value Date By
File Added2752: mocha-pseudo-call.1.patch2007-11-05 10:21purcell
File Added2741: mocha-pseudo-call.patch2007-10-31 14:59purcell