[rspec-users] How much test data to use in specs
baz at madeofstone.net
Wed Aug 27 11:12:14 EDT 2008
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.
Web design and development: http://www.3hv.co.uk/
Nottingham Forest: http://www.eighteensixtyfive.co.uk/
Serious Rails Hosting: http://www.brightbox.co.uk/
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rspec-users