[mocha-developer] using expects with [] (for Hash and Array)

James Mead jamesmead44 at gmail.com
Wed Nov 15 17:06:59 EST 2006


On 15/11/06, Jeremy Burks <jeremy.burks at gmail.com> wrote:
>
> First off, thanks for the great library.
>
> Is there a way setup expects with this:
>
>     runtime_options[:property] = properties_option_string
>
> or do i have to use:
>
>     runtime_options.store(:property, properties_option_string)
>
> which results in this:
>
>     runtime_options.expects(:store).with(:property, 'prop1=1')
>

[]= is just another method, so you should be able to do something like
this...

runtime_options.expects(:[]=).with(:property, 'prop1=1')

-- 
James.
http://blog.floehopper.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/mocha-developer/attachments/20061115/333f7d32/attachment.html 


More information about the mocha-developer mailing list