<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<br><div><div>On 27 Aug 2008, at 16:35, Matt Wynne wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div>describe "when the address is less than two characters long" do</div><div><span class="Apple-tab-span" style="white-space: pre; ">        </span>it "should be invalid" do ... end</div><div>end</div><div><br></div><div>describe "when the address is more than two characters long" do</div><div><br></div><div><span class="Apple-tab-span" style="white-space: pre; ">        </span>describe "and the address is less than 128 characters long" do</div><div><span class="Apple-tab-span" style="white-space: pre; ">                </span>it "should be valid" do ... end</div><div><span class="Apple-tab-span" style="white-space: pre; ">        </span>end<br></div><div><br></div><div><span class="Apple-tab-span" style="white-space: pre; ">        </span>describe "and the address is more than 128 characters long" do<br></div><div><span class="Apple-tab-span" style="white-space: pre; ">                </span>it "should be invalid" do ... end</div><div><span class="Apple-tab-span" style="white-space: pre; ">        </span>end<br></div><div><br></div><div>end</div></span></blockquote><br></div><div>For this, trivial, example, I find that far too verbose.  </div><div><br></div><div>The "specification" says "if it is less than 2 characters then invalid" and "if it is more than 128 characters then invalid" .  </div><div><br></div><div>But you are actually running three checks - "if less than 2", "if greater than 2 but less than 128" and "if greater than 2 and greater than 128".  </div><div><br></div><div>B</div><div><br></div><div><br></div><div> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: 'Helvetica Neue'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: 'Helvetica Neue'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: 'Gill Sans'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: 'Helvetica Neue'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="font-family: Helvetica; "><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px; font-family: Helvetica; "><span class="Apple-style-span" style="font-size: 10px; font-family: Helvetica; "><span class="Apple-style-span" style="font-size: 10px; font-family: Helvetica; "><span class="Apple-style-span" style="font-size: 10px; font-family: Helvetica; "><span class="Apple-style-span" style="font-family: Helvetica; font-size: 10px; "><font class="Apple-style-span" color="#800000"><span class="Apple-style-span" style="color: rgb(128, 0, 0); font-family: Helvetica; font-size: 10px; "><span class="Apple-style-span" style="color: rgb(128, 0, 0); font-family: Helvetica; font-size: 10px; "><span class="Apple-style-span" style="color: rgb(128, 0, 0); font-family: Helvetica; font-size: 10px; "><span class="Apple-style-span" style="color: rgb(128, 0, 0); font-size: 10px; "><span class="Apple-style-span" style="color: rgb(128, 0, 0); font-size: 10px; "><span class="Apple-style-span" style="color: rgb(128, 0, 0); font-size: 10px; "><span class="Apple-style-span" style="color: rgb(128, 0, 0); font-size: 10px; ">Rahoul Baruah</span></span></span></span></span></span></span></font></span></span></span></span></span></font></div><div style="font-family: Helvetica; "><font class="Apple-style-span" color="#7F7F7F" size="2"><span class="Apple-style-span" style="font-size: 10px; color: rgb(127, 127, 127); font-family: Helvetica; "><span class="Apple-style-span" style="color: rgb(127, 127, 127); font-family: Helvetica; font-size: 10px; "><span class="Apple-style-span" style="color: rgb(127, 127, 127); font-size: 10px; "><span class="Apple-style-span" style="color: rgb(127, 127, 127); font-size: 10px; "><i style="color: rgb(127, 127, 127); font-size: 10px; font-style: italic; "><span class="Apple-style-span" style="color: rgb(127, 127, 127); font-size: 10px; font-style: italic; ">Web design and development</span></i><span class="Apple-style-span" style="color: rgb(127, 127, 127); font-size: 10px; "><span class="Apple-style-span" style="color: rgb(127, 127, 127); font-size: 10px; ">: <a href="http://www.3hv.co.uk">http://www.3hv.co.uk</a>/</span></span></span></span></span></span></font></div><div style="font-family: Helvetica; "><font class="Apple-style-span" color="#7F7F7F" size="2"><span class="Apple-style-span" style="font-size: 10px; color: rgb(127, 127, 127); font-family: Helvetica; "><span class="Apple-style-span" style="color: rgb(127, 127, 127); font-size: 10px; font-family: Helvetica; "><span class="Apple-style-span" style="color: rgb(127, 127, 127); font-size: 10px; font-family: Helvetica; "><span class="Apple-style-span" style="color: rgb(127, 127, 127); font-size: 10px; font-family: Helvetica; "><span class="Apple-style-span" style="color: rgb(127, 127, 127); font-family: Helvetica; font-size: 10px; "><span class="Apple-style-span" style="color: rgb(127, 127, 127); font-family: Helvetica; font-size: 10px; "><span class="Apple-style-span" style="color: rgb(127, 127, 127); font-family: Helvetica; font-size: 10px; "><span class="Apple-style-span" style="color: rgb(127, 127, 127); font-family: Helvetica; font-size: 10px; "><span class="Apple-style-span" style="color: rgb(127, 127, 127); font-size: 10px; "><span class="Apple-style-span" style="color: rgb(127, 127, 127); font-size: 10px; "><span class="Apple-style-span" style="color: rgb(127, 127, 127); font-size: 10px; "><span class="Apple-style-span" style="color: rgb(127, 127, 127); font-size: 10px; ">Nottingham Forest: <a href="http://www.eighteensixtyfive.co.uk">http://www.eighteensixtyfive.co.uk</a>/</span></span></span></span></span></span></span></span></span></span></span></span></font></div><div style="font-family: Helvetica; "><font class="Apple-style-span" color="#7F7F7F" size="2"><span class="Apple-style-span" style="font-size: 10px; color: rgb(127, 127, 127); font-family: Helvetica; ">Serious Rails Hosting: <a href="http://www.brightbox.co.uk">http://www.brightbox.co.uk</a>/</span></font></div><div style="font-family: Helvetica; "><font class="Apple-style-span" color="#7F7F7F" size="2"><span class="Apple-style-span" style="font-size: 10px; ">Lifecast: <a href="http://www.madeofstone.net">http://www.madeofstone.net</a>/</span></font></div><div style="font-family: Helvetica; "><font class="Apple-style-span" color="#7F7F7F" size="2"><span class="Apple-style-span" style="font-size: 10px; color: rgb(127, 127, 127); font-family: Helvetica; "><br class="khtml-block-placeholder"></span></font></div><div style="font-family: Helvetica; "><font class="Apple-style-span" color="#7F7F7F" size="2"><span class="Apple-style-span" style="font-size: 10px; color: rgb(127, 127, 127); font-family: Helvetica; "><br class="khtml-block-placeholder"></span></font></div><div style="font-family: Helvetica; "><br class="khtml-block-placeholder"></div><br class="Apple-interchange-newline"></span></span></span></span></span></span></span></span></span></span></span></span><br class="Apple-interchange-newline"></span> </div><br></body></html>