Running MSpec with Resharper


I have just started developing using Behaviour Driven Development and I thought I’d start a new post detailing how I went about doing it. There is in fact a similar titled post available here but it is a bit out of date. So here goes.

  • Get the source code from GitHub

I used GitExtensions to clone the source code from MSpec’s code repository. If you don’t know how to clone a repository, I believe that the GitExtensions site has video tutorials on how to do just that.

  • Generate the dll

There is no need to open the project in Visual Studio and compiling the project in order to get the dll. Instead, go to the folder where you cloned the code to and you will see the following 4 command files:

  • build-3.5-debug.cmd
  • build-3.5-release.cmd
  • build-4.0-debug.cmd
  • build-4.0-release.cmd

Simply run the version of what applies to you i.e. if you want to get the debug dll for .NET 4.0, then pick “build-4.0-debug.cmd”, which I’ve used for this example.

  • Set up Resharper

If all went well in the last step, you should see a bunch of files under “..\Build\Debug”

and in that folder, you’ll find the following files which are of interest to us:

  • InstallResharperRunner.5.0 – VS2008.bat
  • InstallResharperRunner.5.0 – VS2010.bat
  • InstallResharperRunner.5.1 – VS2008.bat
  • InstallResharperRunner.5.1 – VS2010.bat

Run the appropriate version and you should be good to start writing out some tests and running them using ReSharper. I will post another article on how to do just that.

Before ending this post, I’d just like to say that running the previous batch file isn’t always reliable probably due to file writing persmission issues. However, it’s simply a matter of opening the relevant batch file and understanding what it is doing and replicating the operations manually.

So for instance “InstallResharperRunner.5.1 – VS2010.bat” contains the following

mkdir “%APPDATA%\JetBrains\ReSharper\v5.1\vs10.0\Plugins”
copy Machine.Specifications.dll “%APPDATA%\JetBrains\ReSharper\v5.1\vs10.0\Plugins”
copy Machine.Specifications.pdb “%APPDATA%\JetBrains\ReSharper\v5.1\vs10.0\Plugins”
copy Machine.Specifications.ReSharperRunner.5.1.dll “%APPDATA%\JetBrains\ReSharper\v5.1\vs10.0\Plugins”
copy Machine.Specifications.ReSharperRunner.5.1.pdb “%APPDATA%\JetBrains\ReSharper\v5.1\vs10.0\Plugins”

which is simply saying:

create a folder within “%APPDATA%”

copy each of the files, Machine.Specifications.dll, Machine.Specifications.pdb, Machine.Specifications.ReSharperRunner.5.1.dll and Machine.Specifications.ReSharperRunner.5.1.pdb in the current folder, where the batch file is running, to the newly created folder.

Finally, if you can’t wait for the next post to see whether you’ve successfully set up Resharper to run with MSpec, then go to Byron Sommardahl’s blog post on just how to do that. This blog post contains a list of links which will help you get started with MSpec.

 

Advertisements
Tagged with: ,
Posted in BDD, MSpec

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: