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.

So:
* 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.

Baz

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/






_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to