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
                it "should be valid" do ... end
        end

        describe "and the address is more than 128 characters long" do
                it "should be invalid" do ... end
        end

end

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", "if greater than 2 but less than 128" and "if greater than 2 and greater than 128".

B


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
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to