Some time ago, I handed off maintenance of MSpec to Alexander Groß. He has continued to add features, fix bugs, tweak and fine tune various aspects of MSpec. I’m forever grateful for his efforts.
Over the past few days, he pushed several changes, some breaking, so I wanted to call them out here. Below his his note on the machine user group.
I’ve pushed some changes to MSpec over the last couple of days and wanted to let you know what changed:
– Runners for x86/AnyCPU, .NET 3.5 and 4.0 in one zip
Runners for all these architectures/CLRs are now in one package.
mspec.exe -> AnyCPU, CLR 2.0
mspec-clr4.exe -> AnyCPU, CLR 4.0
mspec-x86.exe -> x86, CLR 2.0
mspec-x86c-clr4.exe -> x86, CLR 4.0
This is possibly a breaking change as mspec.exe was x86 traditionally. Most unit testing frameworks (xUnit, NUnit) follow the same convention.
– Machine.Specifications.dll is not strong-named by default
We had to strong name our framework assembly to support some very specific scenarios.
We removed the strong name for our default build because SNs cause more problems than they solve. You can always build with signing turned on by running the build as follows:
Builds started from inside Visual Studio will not be signed by default. There are two build configurations on our TeamCity server, one for the unsigned and one for the signed configuration:
There’s an extra NuGet package for the signed build, see below.
– Assembly versioning
From now on releases will be versioned correctly. (We re-released 0.3.0.0 over the last couple of months.) The version number is generated by TeamCity. Builds on your local machine will compile as 0.4.0.0. You can override this:
For such a build, the zip and NuGet packages will have a “Testing” suffix, such that you can easily test these: Install-Package Machine.Specifications-Testing
build.cmd VERSION=0.4.3.2 SIGN_ASSEMBLY=true creates a signed Machine.Specifications.dll with version number 0.4.3.2.
– A better NuGet package
I updated the NuGet package for MSpec. That is, we have two packages: Machine.Specifications and Machine.Specifications-Signed. You correctly guessed what’s different The package contains the framework DLL (inside /lib) as well as the runners (in /tools).
– Versioning and the ReSharper runner
You will very likely encounter problems if you update Machine.Specifications (0.4.x) in your project but not the ReSharper runner (still 0.3.0.0, strong-named). The result is gray icons next to the specification nodes in the Unit Test Session window.
The problem can be solved easily by updating the ReSharper runner. The updated ReSharper runners now contains some logic to check if the runner is compatible the project and will display an error message if not.
Please let me know if you encounter any problems with the new builds!
You can check out the readme on the github project for more info and download links. Enjoy!