Well, that certainly took long enough.  It’s been nearly a year since I first blogged about SpecsFor 3.0, but I just pushed the final version to NuGet a short while ago.


This release includes a few breaking changes, but for the most part your tests that were created with SpecsFor V2 should continue to work exactly the same as before.  Here’s a quick rundown of the changes:

  • Breaking Change – AfterEachSpec renamed to AfterEachTest – This change was made to better reflect when the callback is actually run: after each individual test case.
  • Breaking Change – AfterSpec callback method added –  You can use this to run any final cleanup after all the tests within a spec have executed.
  • Breaking Change – Attribute-based method of applying context removed completely –  This feature was seldom used from what I can tell, ill-conceived to begin with, and not properly supported by some popular test runners (I’m looking at you, Resharper).
  • Composable Context System – You can now define standalone behaviors that will be applied to your specs based on conventions you specify.  Create a SetUpFixture derived from SpecsForConfiguration to get started.
  • New extension methods – There are some new methods to help with testing.  I’ll run through these in an upcoming post.
  • Complete internal rewrite – I was never happy with the SpecsFor base class.  It started off with too many responsibilities, and it only grew with each release.  I’ve refactored and simplified things while doing my best to preserve compatibility with existing tests.  Let me know if I failed. 🙂

In the coming weeks (or months?) I’ll go in-depth with each of these changes here on this blog.  I’ll also get the main site updated with better docs and examples.  If anyone would like to help, please let me know.