Created
May 24, 2011 01:44
-
-
Save mattflo/988012 to your computer and use it in GitHub Desktop.
This file contains 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 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