Sponsored By Aspose - File Format APIs for .NET

Aspose are the market leader of .NET APIs for file business formats – natively work with DOCX, XLSX, PPT, PDF, MSG, MPP, images formats and many more!

MSpec v0.3

IMPORTANT NOTE: This is beta (still). The assertion library is new and may have bugs. I’d appreciate you testing it on your specs, but don’t fight specs breaking too hard if they do, let me know what happened and revert, I wouldn’t want to cost you your day chasing down a bug in MSpec. Thanks!

It’s been more or less forever since I’ve incremented the version number of MSpec so I went ahead and did it today. This is just a brief post to let you know what’s new and what I broke—maybe I’ll post some more detail later.

MOST IMPORTANT NOTE: v0.3 removes the dependency on NUnit/XUnit. If you’re upgrading, delete your Machine.Specifications.NUnit.dll and Machine.Specifications.XUnit.dll and remove their references from your projects. MSpec has an all new assertion library (with a bit of borrowed code from XUnit, turns out equality is hard).

I’ve attempted to format the new error messages to minimize debugging, so they’re rather verbose. Please let me know if they are too verbose or if there’s anything else you’d like to see.

You may need to tweak a few specs (ex. ShouldEquals is now generic, so you have to pass it the same type as the thing you’re observing) but most things should “just work”. Let me know if any of the new assertions give pain.

I also added a XCopy Deployable Test Runner manifest for TD.NET so no more fiddling with the registry or dealing with version issues. Pretty slick really. Thanks Jamie for pointing this out to me.

Of course there are plenty of other changes from 0.2 to 0.3 since it’s been like, a year. Here’s some others off the top of my head:

  • R# runners for 4.0, 4.1, 4.5 and 5.0 and they’re better than ever thanks to Alexander Groß.
  • Xml output from the command line runner with –xml for CC.NET/Hudson thanks to Barry Woods.
  • Concern is now Subject
  • There is no longer a difference between “Establish context” and “Establish context_once”, the context is always established only once. The idea is that observations are observations, they should not mutate state so there is no reason to execute the context more than once. Same for cleanup. If you *really* want to do execute the context for each specification, first try to change your mind, then if you still want it use: [SetupForEachSpecification] on your context class.
  • You can implement an IAssemblyContext in your spec assembly to set things up before or clean things up after all of your specs in that assembly have run.
  • You can implement a ICleanupAfterEveryContextInAssembly to perform cleanup after every context (think cleaning up static state, resetting your ServerClock/DateTime replacement for example.
  • Selenium RC support

Many thanks again to Alexander Groß for adding packaging to MSpec. You can now download builds from herewithout having to build it yourself! Just grab the Artifact from the latest build.

And, as always, the best way to get me is on twitter.

This entry was posted in bdd, machine, mspec. Bookmark the permalink. Follow any comments here with the RSS feed for this post.
  • http://www.bananacoding.com Jirapong

    Thank you. It is a great tool!

  • http://codebetter.com/members/hdierking/default.aspx hdierking

    Awesome Aaron – looking forward to playing with it!