Created
July 5, 2011 19:47
-
-
Save kouphax/1065724 to your computer and use it in GitHub Desktop.
NSpec Debugger Shim
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
as of 0.9.46 line 31 needs to be: new ContextRunner(builder, new ConsoleFormatter()).Run();