[mocha-developer] Partial matches in expectations

James Mead jamesmead44 at gmail.com
Tue Nov 28 10:24:34 EST 2006


On 28/11/06, Francois Beausoleil <francois.beausoleil at gmail.com> wrote:
>
> I would like to ascertain the following in a test case:
>
> @template.expects(:content_tag).with(:fieldset,
> :__any_arguments__i_dont_care)
>
> Is it possible to do so ?  If so how ?


It should be possible to do this as follows...

@template.expects(:content_tag).with { |*params| params.first == :fieldset }

The with() block should return true or false depending on whether the
expectation should match.

-- 
James.
http://blog.floehopper.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/mocha-developer/attachments/20061128/890622e0/attachment.html 


More information about the mocha-developer mailing list