[rspec-users] Stopping example execution?

Mikel Lindsaar raasdnil at gmail.com
Sun Jun 29 22:38:37 EDT 2008

On Mon, Jun 30, 2008 at 2:59 AM, David Chelimsky <dchelimsky at gmail.com> 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)

Rails, RSpec, Puppet and Life blog....

More information about the rspec-users mailing list