On Mon, Jun 30, 2008 at 2:59 AM, David Chelimsky <[EMAIL PROTECTED]> wrote: > On Jun 29, 2008, at 11:38 AM, Britt Mileshosky wrote: >>> My instinct about this is that it would encourage long methods because >>> it would make it less painful to test them, so I would be adverse to >>> anything that let's you short circuit the method. >>> >>> Anybody else have opinions on that?
I agree with you here David. The long method syndrome is so easy to fall into in ruby and rails especially. Many times I have shown some of my team mates that coding small methods makes specing a lot easier and containable. Another way to go about this testing is to treat the controller method as a public interface and only spec the 'end result' behaviour with a given set of inputs using real objects (which has limits, but works in most cases). Britt, have a look at http://lindsaar.net/2008/6/30/examples-of-behaviour-spec-n to see what I mean. Doesn't totally solve the problem you are hitting now, but provides you with another way to go about it (albeit a bit slower in spec execution time) -- http://lindsaar.net/ Rails, RSpec, Puppet and Life blog.... _______________________________________________ rspec-users mailing list [email protected] http://rubyforge.org/mailman/listinfo/rspec-users
