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

Rahoul Baruah baz at madeofstone.net
Wed Aug 27 11:12:14 EDT 2008

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 three points are your specification  
then your RSpec should match that.

* it "should not begin with a digit",
* it "should not be shorter than 2 characters",
* it "should not be longer than 128 characters" and
* it "should allow valid addresses" (this is for clarity, so you have  
an example of a valid address in your documentation).

If your regex allows or disallows more or less than those four  
clauses then your specification does not match your implementation.


Rahoul Baruah
Web design and development: http://www.3hv.co.uk/
Nottingham Forest: http://www.eighteensixtyfive.co.uk/
Serious Rails Hosting: http://www.brightbox.co.uk/
Lifecast: http://www.madeofstone.net/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20080827/9e8d3040/attachment-0001.html>

More information about the rspec-users mailing list