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

Jeremy Burks jeremy.burks at gmail.com
Wed Nov 15 18:02:50 EST 2006


Aahhhh, yes. That makes sense now that i am looking at it.

Thanks.
jeremy

On 11/15/06, James Mead <jamesmead44 at gmail.com> wrote:
> 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
> _______________________________________________
> mocha-developer mailing list
> mocha-developer at rubyforge.org
> http://rubyforge.org/mailman/listinfo/mocha-developer
>
>


More information about the mocha-developer mailing list