On Sun, Mar 9, 2008 at 4:46 AM, David Chelimsky <[EMAIL PROTECTED]> wrote:
> On Sat, Mar 8, 2008 at 11:06 PM, Pat Maddox <[EMAIL PROTECTED]> wrote:
>  > I've always used do_post/do_put etc. But your way is perfectly acceptable 
> :)
>
>  That's what I do too - but I like Zach's idea here. Do you guys think
>  the generated examples should use this?

I'm indifferent to it.  The reason I use do_put instead of put_update
is because when dealing with resources, the interface is PUT
/resource.  The fact that it maps to the #update method is a Rails
implementation detail.  So I find it useful to name that little helper
method in a way that reflects the external API.

That's just the way I think of it though.  I'd be pissed off if
someone did a global search and replace on my code, but for RSpec
generated code I don't have a strong opinion.  I think it raises an
interesting philosophical issue though.  We care about naming a great
deal, so do_request->post_create is certainly an improvement.  And for
me, do_post is better than post_create, because my apps are all
RESTful.  So the question in my mind is whether our suggestion ends at
better naming, or if we ought to subtly encourage more RESTful apps,
which seems to be a widespread good practice in the Rails community.

I'm also afraid that this is a bike shed scenario and I'm thinking way
too deeply into it.  Someone please show me the light :)

Pat
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to