On 9/3/07, Scott Taylor <[EMAIL PROTECTED]> wrote:
>
> On Sep 3, 2007, at 5:19 AM, Rodrigo Alvarez Fernández wrote:
>
> > I would like to know if the mock framework will be deprecated, since I
> > have a pair of feature requests, and I don't know where to request
> > them:
> >
> > 1) Alternative expectations:
> >
> > mock.should_receive(:save).
> >   and_return(false).
> >   or_receive(:save!).
> >   and_raise(ActiveRecord::RecordNotSaved)
> >
> > 2) Chained stubs/expectations
> >
> > mock.stub!(:valid?).and_return(false)
> > mock.stub!(:valid?).and_return(true).after_receiving
> > (:save).and_return(true)
> >

Maybe this can be accomplished with ordered stubs. rSpec mocks support
only ordered expectations, doesn't it?

> > I'm sure that this needs no more explanation :)
>
> Or we could do as flexmock does (and which I find much more readable):
>
> mock.stub!("method1.method2.method3").and_return(true)
>
> Scott
>
> _______________________________________________
> rspec-users mailing list
> rspec-users@rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


-- 
http://papipo.blogspot.com
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to