Skip to content

Instantly share code, notes, and snippets.

@Ang3lFir3
Created May 19, 2011 15:27
Show Gist options
  • Save Ang3lFir3/981023 to your computer and use it in GitHub Desktop.
Save Ang3lFir3/981023 to your computer and use it in GitHub Desktop.
NSpec NUnit Shim
[TestFixture]
public class DebuggerShim
{
[Test]
public void AllTests()
{
var finder = new ShimFinder(typeof(DebuggerShim).Assembly.GetTypes());
var builder = new ContextBuilder(finder, new DefaultConventions());
var runner = new ContextRunner(builder);
runner.Run();
if (runner.Failures().Count() != 0)
Assert.Fail("Some NSpec test failed");
}
}
public class ShimFinder : ISpecFinder
{
private Type[] types;
public ShimFinder(Type[] types)
{
this.types = types;
}
public IEnumerable<Type> SpecClasses()
{
return types;
}
}
@jaboc83
Copy link

jaboc83 commented Aug 29, 2011

It appears the API has changed some. Is there an easy way to do this now, as I don't see the Failures available from the ContextRunner class??

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