On Mar 5, 2008, at 2:57 PM, "Rick DeNatale" <[EMAIL PROTECTED]>  
wrote:

> On Wed, Mar 5, 2008 at 1:31 PM, David Chelimsky  
> <[EMAIL PROTECTED]> wrote:
>> On Mar 5, 2008, at 11:43 AM, "Rick DeNatale"  
>> <[EMAIL PROTECTED]>
>>
>> wrote:
>>
>>> On Wed, Mar 5, 2008 at 12:28 PM, Rick DeNatale <[EMAIL PROTECTED]
>>>> wrote:
>>>> I'm wanting to write a spec that a model is applying an :order  
>>>> option
>>>> to a find call, but I don't want to completely specify all of the
>>>> find
>>>> parameters.
>>>>
>>>> So I want to write something like this, say in a controller spec
>>>>
>>>>  User.should_receive(:find).with(:all, hash_with_at_least(:order =>
>>>> 'user.name ASC'))
>>>>  get 'index', :sort => 'up'
>>
>> I really like this idea. What about something more general that can
>> handle the first n args too?
>
> That's a horse of a different color I think.  It would need to dig
> into MessageExpectation#with and/or the way ArgumentExpectations are
> built.
>
> Dealing with it an argument at a time is easy since it just needs ==
> to 'do the right thing' on an argument 'proxy'.

Agreed.

I think hash_with would be clear enough and a bit more terse. Agree?

>
>
> -- 
> Rick DeNatale
>
> My blog on Ruby
> http://talklikeaduck.denhaven2.com/
> _______________________________________________
> rspec-users mailing list
> rspec-users@rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to