Skip to content

Instantly share code, notes, and snippets.

@kouphax
Created July 5, 2011 19:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kouphax/1065724 to your computer and use it in GitHub Desktop.
Save kouphax/1065724 to your computer and use it in GitHub Desktop.
NSpec Debugger Shim
using System;
using NUnit.Framework;
using NSpec.Domain;
using System.Reflection;
using NSpec;
namespace DynamicBlog.Tests
{
[TestFixture]
public class DebuggerShim
{
[Test]
public void debug()
{
//the specification class you want to test
//this can be a regular expression
var testClassYouWantToDebug = "describe_Blog";
//initialize NSpec's specfinder
var finder = new SpecFinder(
Assembly.GetExecutingAssembly().Location,
new Reflector(),
testClassYouWantToDebug);
//initialize NSpec's builder
var builder = new ContextBuilder(
finder,
new DefaultConventions());
//this line runs the tests you specified in the filter
new ContextRunner(builder, new ConsoleFormatter()).Run();
}
}
}
@amirrajan
Copy link

as of 0.9.46 line 31 needs to be: new ContextRunner(builder, new ConsoleFormatter()).Run();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment