I've tidied up a lot of the code, made it self testing, added SetUp
and TearDown attributes, and added the rather cool BehaviourOutput
switch, which provides a human readable spec like this...
NSpec: NSpec 2007.0
Runtime: 2.0.50727.42
OS: Microsoft Windows NT 5.1.2600 Service Pack 2
Assembly:C:\Documents and Settings\thaughton\My Documents\NSpec SVN
\trunk\bin\release\Nspec.Framework.Specification.dll
Referential Equality Evaluation Specification
* Should Register Success When Referentially Equal
* Should Register Failure When Referentially Unequal
False Condition Evaluation Specification
* Should Register Success With False Result
* Should Register Failure With True Result
Spec Runner Spec
* Should Find All Spec Classes In Assembly
* Should Run All Spec Methods
Floating Point Comparison Specification
* Should Register Success With Successful Compare
* Should Register Success With 2Na Ns
* Should Register Success With 2Equal Infinities
* Should Register Failure With 2Unequal Floats
* Should Register Failure With 1Nan
etc...
I'm curious. What's your take on the latest movement in NUnit syntax:
http://nunit.com/blogs/?p=44
This seems very similar to what NSpec is doing. Do they differ?
- Jody
On Feb 13, 5:32 am, "Tim Haughton" <timhaugh...@gmail.com> wrote:
> I've released NSpec v2007.0. You can grab it fromhttp://nspec.org.
I've been chatting with Charlie Poole and others in the TDD/BDD
community about the new syntax for NUnit. NUnit's will always be
different, simply because it uses exceptions to register failures,
whereas NSpec doesn't. IIRC, NUnit's is along the lines of...
Assert.That( Is.False( myBool ) );
or something similar. It's a good attempt at a more fluent syntax
given NUnit's constraints. For me, the 'Assert' name is still a little
test oriented, but it is trivial since he (or a user) could also add a
class called specify with the same interface. We also discussed
expanding test fixture and method names in the tree, so that...
[TestFixture]
public class WhenOKButtonIsClicked
{
[Test]
public void PasswordShouldBeSentToController()
{
}
}
Looks like...
When OK Button Is Clicked
---Password Should Be Sent To Controller
in the tree. It's a cosmetic change, but I still feel that the Neuro
Linguistic Programming aspects of BDD are still a little undervalued
in NUnit's approach. But then Charlie is a lot smarter than me, so I
could very easily be wrong :)
Regards,
Tim Haughton