Enable Machine.Specification’s TestDriven.NET runner
I recently downloaded v0.2 of Aaron Jensen’s Machine.Specifications library for .NET and ran into a hurdle activating TestDriven.NET integration with Visual Studio 2008.
Aaron’s instructions say:
- Grab the drop here.
- Extract it somewhere. Put it somewhere semi-permanent because the TestDriven.NET runner will need a static location for the MSpec TDNet Runner.
- If you want TestDriven.NET support, run InstallTDNetRunner.bat
- Check out the example in Machine.Specifications.Example. Note that you can run with TD.NET.
- Create a project of your own. Just add Machine.Specifications.dll and get started.
I tried this and it didn’t work for me; TD.Net would run on my spec class and show “0 Passed, 0 Failed, 0 Skipped”.
Turns out there’s a missing step in there. I had to grab Rake and build it, of course, but after that:
When you run InstallTDNetRunner.bat in step 3, it must execute in the folder containing the binaries that you want to register.
In my case, after I copied {MSpec source}/Distribution/Specifications/InstallTDNetRunner.bat into {MSpec source}/Build/Debug/, the folder containing Machine.Specifications.TDNetRunner.dll, I ran it and it all worked beautifully.
Passing specs show up as Passed, Not Implemented specs show up as Skipped, and Failed specs show up as Errors in the IDE that I can click through to the offending specification. Brilliant.
I’ve been absorbing a lot of content lately about BDD and really like the way that the Context-Specification pattern reads. I don’t plan to use it for low-level unit tests but I’m very excited about functional integration tests that are readable by my client, and thrilled at the out-of-the-box integration with VS.