Evan Weaver on 14 Sep 2007 01:12:58 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PhillyOnRails] rspec slides

  • From: "Evan Weaver" <evan@cloudbur.st>
  • To: talk@phillyonrails.org
  • Subject: Re: [PhillyOnRails] rspec slides
  • Date: Thu, 13 Sep 2007 21:12:47 -0400
  • Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=mMwfoT/PjcQPg4DV7Sojk03uAQ/ysVFRqOXtTCnsRlE=; b=C6eyIBvUcLwEBgaP46PeM0Ip07hT76n3nBKDMEIzOQOqvYeW4IBFWvB+C2w3O//vRLZyum+LarPCh3LoMfNoRJ8opHBuJ9fiRZS8FmXGgQO/K2i+msuNAxkB23UQL4OhJeAw3QYsbiwwyZvtN4Hejw4WZHRh0Tpa1MF7SLcsAhw=
  • List-archive: <http://lists.phillyonrails.org/pipermail/talk>
  • Reply-to: talk@phillyonrails.org
  • Sender: talk-bounces@phillyonrails.org

I see now that the validates_ line is from the model, and that you are
advocating not writing this kind of test. :)

Anyway. Jay's post is still good.

Evan

On 9/13/07, Evan Weaver <evan@cloudbur.st> wrote:
> On 9/13/07, Cassius Rosenthal <cassius@xmodulation.com> wrote:
>
> >   user.login.length.should be_close( 8, 4 )
>
> >   validates_length_of :login, :within => 4..12
>
> Do you really write tests like this? I think Jay Levitt's post is
> applicable: http://rubyforge.org/pipermail/rspec-users/2007-September/002973.html
>
> My tests are always micro workflows (in Test::Unit or test/spec)
> rather than perfectly coupled unit tests. In both of these examples
> you are basically testing whether 8 + 4 = 12. Why not test some actual
> usernames of various edge lengths, instead?
>
> Evan
>
> --
> Evan Weaver
> Cloudburst, LLC
>


-- 
Evan Weaver
Cloudburst, LLC
_______________________________________________
To unsubscribe or change your settings, visit:
http://lists.phillyonrails.org/mailman/listinfo/talk