Home > BDD > dSpec alpha

dSpec alpha

February 23rd, 2007

Release early and release often … =)

I’ve uploaded my first go-around here: http://www.delphixtreme.com/downloads/dspec/dSpec.rar

dSpec is an extension of the DUnit framework. Behavior specifications are creating by descending from TContext (instead of TTestCase) and using published methods to execute the specifications (just like in DUnit). As discussed in the previous blog entry you assert behavior using the Specify.That method instead of using CheckEquals. Where before we would have said:

if WeAreInSectorZZ9PluralZAlpha then
CheckNotEquals(42, TheAnwserToLifeTheUniverseAndEveryThing)
else
CheckEquals(42, TheAnwserToLifeTheUniverseAndEverything)

We can now say:

Specify.That(TheAnwserToLifeTheUniverseAndEverything).ShouldEqual(42).Unless(WeAreInSectorZZ9PluralZAlpha);

(that line was a little too long for this blog theme. See the example project for the whole Hitchhikers Guide to the Galaxy joke =P )

As you can see we can modify the specification “ShouldEqual” with “Unless”. We can even say:

Specify.That(f).ShouldEqual(3.5).WithAToleranceOf(0.01).Unless(ToleranceIsInvalid)

Here we string together many modifiers.

See the dSpecBehaviors project in the specifications folder of the archive for more examples.

Remember this is a first stab. I only implemented enough to show how this sort of thing might work. I’m interested in hearing your comments.

BDD

  1. July 27th, 2010 at 18:51 | #1

    it was a wonderful chance to visit this kind of site and I am happy to know. thank you so much for giving us a chance to have this opportunity!

  2. August 3rd, 2010 at 18:20 | #2

    I appreciate yout report.

  3. August 21st, 2010 at 05:28 | #3

    I found your website perfect for my needs. It contains wonderful and helpful posts. I have read most of them and got a lot from them.

  4. September 1st, 2010 at 19:49 | #4

    Best canon Coffee Mugs! Funny, Cute, & Humorous Unique designs. Also find Travel Mugs, Coffee Cups also, or Create Photo Personalized Mugs & Drinkware

  1. No trackbacks yet.

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word