mattflo/NSpec — pull request #20 by jboarman (2011-10-24 22:21:54+00:00)
Title: Tags and Tag Filtering, Setting Exception Expectations for Act

Hi Matt (and Amir),

I'm not sure if I'm breaking protocol or whether these commits will be accepted, but I took a field trip through your project code and couldn't help but add to the project in some way. ;)

The main things I worked on were:

(1) A way to handle exceptions that are thrown during the Act phase (see describe_expected_exception_in_act.cs):

> act = () => { throw new InvalidOperationException( "Testing" ); };
> it[ "should throw exception" ] = expect< InvalidOperationException >();

(2) A way to tag contexts and examples so that the nspec runner can filter out unwanted specs (see describe_tag_filtering.cs):

> it[ "is a tagged example", "@mytag" ] = () => { true.should_be_true(); }

The nspecrunner has been updated to include or exclude with tag filters such as:

> nspecrunner SampleSpecs.dll --tag @mytag-one,~mytag-two

-Jonathan, 469-939-9908