Re: [rspec-users] How much test data to use in specs

2008-08-29 Thread Nick Hoffman
On 2008-08-29, at 11:05, David Chelimsky wrote: On Fri, Aug 29, 2008 at 9:03 AM, Nick Hoffman <[EMAIL PROTECTED]> wrote: On 2008-08-29, at 04:51, Joseph Wilk wrote: I started using a set of methods to deal with this problem from code in the RadiantCMS(http://radiantcms.org/) project. http

Re: [rspec-users] How much test data to use in specs

2008-08-29 Thread David Chelimsky
On Fri, Aug 29, 2008 at 9:03 AM, Nick Hoffman <[EMAIL PROTECTED]> wrote: > On 2008-08-29, at 04:51, Joseph Wilk wrote: >> >> I started using a set of methods to deal with this problem from code in >> the RadiantCMS(http://radiantcms.org/) project. >> >> http://gist.github.com/7936 >> >> I stopped u

Re: [rspec-users] How much test data to use in specs

2008-08-29 Thread Nick Hoffman
On 2008-08-29, at 04:51, Joseph Wilk wrote: I started using a set of methods to deal with this problem from code in the RadiantCMS(http://radiantcms.org/) project. http://gist.github.com/7936 I stopped using it after a while finding the tests did not read well. Your method improves on Radiant

Re: [rspec-users] How much test data to use in specs

2008-08-29 Thread Joseph Wilk
I started using a set of methods to deal with this problem from code in the RadiantCMS(http://radiantcms.org/) project. http://gist.github.com/7936 I stopped using it after a while finding the tests did not read well. Your method improves on Radiant's which has tempted me to start testing mode

Re: [rspec-users] How much test data to use in specs

2008-08-28 Thread Nick Hoffman
On 2008-08-28, at 08:31, David Chelimsky wrote: On Wed, Aug 27, 2008 at 2:24 PM, Nick Hoffman <[EMAIL PROTECTED]> wrote: On 2008-08-27, at 14:46, David Chelimsky wrote: If you want to (not necessarily advising this, but I've seen it done) you can do this: ['!','(',')','&'].each do |char|

Re: [rspec-users] How much test data to use in specs

2008-08-28 Thread David Chelimsky
On Wed, Aug 27, 2008 at 2:24 PM, Nick Hoffman <[EMAIL PROTECTED]> wrote: > On 2008-08-27, at 14:46, David Chelimsky wrote: >> >> If you want to (not necessarily advising this, but I've seen it done) you >> can do this: >> >> ['!','(',')','&'].each do |char| >> it "can't have #{char}" do >>...

Re: [rspec-users] How much test data to use in specs

2008-08-27 Thread Nick Hoffman
On 2008-08-27, at 14:46, David Chelimsky wrote: If you want to (not necessarily advising this, but I've seen it done) you can do this: ['!','(',')','&'].each do |char| it "can't have #{char}" do ... end end That makes the output very verbose, but the spec file is easy to grok. Hi Da

Re: [rspec-users] How much test data to use in specs

2008-08-27 Thread Chuck Remes
We'd recommend that you start sending our your resumé. :) cr On Aug 27, 2008, at 1:55 PM, Jonathan Linowes wrote: what if my office were at Route 102 & Yahoo! Way, Suite #123 :) On Aug 27, 2008, at 2:03 PM, Nick Hoffman wrote: On 2008-08-27, at 12:57, Rahoul Baruah wrote: For th

Re: [rspec-users] How much test data to use in specs

2008-08-27 Thread Mark Wilden
On Wed, Aug 27, 2008 at 12:05 PM, Nick Hoffman <[EMAIL PROTECTED]> wrote: > On 2008-08-27, at 14:55, Jonathan Linowes wrote: > >> what if my office were at >> >>Route 102 & Yahoo! Way, Suite #123 >> >> :) >> > > Good point. Thinking about it again, there's probably not all that much > need

Re: [rspec-users] How much test data to use in specs

2008-08-27 Thread Nick Hoffman
On 2008-08-27, at 15:24, Nick Hoffman wrote: Hi David. I ended up creating valid and invalid test data, as well as a method to iterate over them and write the descriptions and examples for me. You can have a look at it at http://pastie.org/ 261175 . If you have any suggestions for improvement

Re: [rspec-users] How much test data to use in specs

2008-08-27 Thread Nick Hoffman
On 2008-08-27, at 14:55, Jonathan Linowes wrote: what if my office were at Route 102 & Yahoo! Way, Suite #123 :) Good point. Thinking about it again, there's probably not all that much need to prevent addresses from having symbols such as !, &, ", etc. If people really want to put

Re: [rspec-users] How much test data to use in specs

2008-08-27 Thread Jonathan Linowes
what if my office were at Route 102 & Yahoo! Way, Suite #123 :) On Aug 27, 2008, at 2:03 PM, Nick Hoffman wrote: On 2008-08-27, at 12:57, Rahoul Baruah wrote: For this, trivial, example, I find that far too verbose. The "specification" says "if it is less than 2 characters then i

Re: [rspec-users] How much test data to use in specs

2008-08-27 Thread David Chelimsky
On Wed, Aug 27, 2008 at 1:03 PM, Nick Hoffman <[EMAIL PROTECTED]> wrote: > On 2008-08-27, at 12:57, Rahoul Baruah wrote: > >> For this, trivial, example, I find that far too verbose. >> >> The "specification" says "if it is less than 2 characters then invalid" >> and "if it is more than 128 charac

Re: [rspec-users] How much test data to use in specs

2008-08-27 Thread Nick Hoffman
On 2008-08-27, at 12:57, Rahoul Baruah wrote: For this, trivial, example, I find that far too verbose. The "specification" says "if it is less than 2 characters then invalid" and "if it is more than 128 characters then invalid" . But you are actually running three checks - "if less than 2",

Re: [rspec-users] How much test data to use in specs

2008-08-27 Thread Rahoul Baruah
On 27 Aug 2008, at 16:35, Matt Wynne wrote: describe "when the address is less than two characters long" do it "should be invalid" do ... end end describe "when the address is more than two characters long" do describe "and the address is less than 128 characters long" do

Re: [rspec-users] How much test data to use in specs

2008-08-27 Thread Matt Wynne
On 25 Aug 2008, at 17:53, Nick Hoffman wrote: At the moment, my plan is to spec out the following possibilities. A property is invalid if its address: 1) doesn't begin with a digit; 2) is shorter than 2 characters; 3) is longer than 128 characters; Personally I think that if those three p

Re: [rspec-users] How much test data to use in specs

2008-08-27 Thread Rahoul Baruah
Hi all, On 25 Aug 2008, at 17:53, Nick Hoffman wrote: At the moment, my plan is to spec out the following possibilities. A property is invalid if its address: 1) doesn't begin with a digit; 2) is shorter than 2 characters; 3) is longer than 128 characters; Personally I think that if those

Re: [rspec-users] How much test data to use in specs

2008-08-25 Thread David Chelimsky
On Mon, Aug 25, 2008 at 3:02 PM, Zach Dennis <[EMAIL PROTECTED]> wrote: > On Mon, Aug 25, 2008 at 2:50 PM, Nick Hoffman <[EMAIL PROTECTED]> wrote: >> On 2008-08-25, at 13:29, Zach Dennis wrote: >>> >>> I might do something like the following... >>> >>> describe Property, "email validations" do >>>

Re: [rspec-users] How much test data to use in specs

2008-08-25 Thread Zach Dennis
On Mon, Aug 25, 2008 at 2:50 PM, Nick Hoffman <[EMAIL PROTECTED]> wrote: > On 2008-08-25, at 13:29, Zach Dennis wrote: >> >> I might do something like the following... >> >> describe Property, "email validations" do >> >> ["[EMAIL PROTECTED]", "can't start with a digit", >> "[EMAIL PROTECTED]",

Re: [rspec-users] How much test data to use in specs

2008-08-25 Thread Nick Hoffman
On 2008-08-25, at 13:29, Zach Dennis wrote: I might do something like the following... describe Property, "email validations" do ["[EMAIL PROTECTED]", "can't start with a digit", "[EMAIL PROTECTED]", "can't end with a digit" ].in_groups_of(2) do |email, description| it description do

Re: [rspec-users] How much test data to use in specs

2008-08-25 Thread Zach Dennis
On Mon, Aug 25, 2008 at 12:53 PM, Nick Hoffman <[EMAIL PROTECTED]> wrote: > I'm not sure how much test data I should be using in my specs. I'm writing > specs for the Property model in my Rails app. Its "address" attribute is > going to be validated with this regex: > /\A\d+[a-z]? [-', a-z]{2,128}\