Skip to content

Instantly share code, notes, and snippets.

@mattflo
Created May 24, 2011 01:44
Show Gist options
  • Save mattflo/988012 to your computer and use it in GitHub Desktop.
Save mattflo/988012 to your computer and use it in GitHub Desktop.
using NSpec;
using NSpec.Domain;
namespace SampleSpecs.Demo
{
class describe_explicit_examples : nspec
{
void hey_there()
{
specify = () => "one way".should_be("one way");
"another way".Is("another way");
}
}
public static class IsExtention
{
public static void Is(this object actual, object expected)
{
nspec.CurrentContext.AddExample(new Example("{0} is {1}".With(actual,expected), ()=> actual.should_be(expected)));
}
}
// $ rake samples[describe_explicit_examples]
//(in C:/Users/matt/AppData/Roaming/Local Libraries/Local Documents/Visual Studio 2010/Projects/NSpec)
//NSpecRunner/bin/debug/NSpecRunner.exe SampleSpecs/bin/debug/SampleSpecs.dll describe_explicit_examples
//describe explicit examples
// hey there
// one way should be one way
// another way is another way
//2 Examples, 0 Failed, 0 Pending
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment