Open BennieCopeland opened 7 years ago
I can try and find the time to create a PR for this over the next few weeks, but I was REALLY hoping the project had moved on from project.json
. I don't look forward to reinstalling 2015.
@BennieCopeland there shouldn't be any "bare" code within the blocks. You need to put
int someValue = int.MaxValue;
MyClass myClass = null;
bool expectException = false;
Action action = null;
into the before
.
@amirrajan That fails to build because the variables are now out of scope.
you have to make all your variables members of the test (class level).
That would work, but it could lead to a lot of variables at the class
scope. I've never had a problem with scoping inside the context
s. But this is getting away from what this issue is about, which is a feature request for changing the exception handling behavior. Right now, context failures color the tests red (which is great), but I would like it to also hand the tests the caught exception for inspection.
But this is getting away from what the issue is about.
Yep sorry about that. Here is some food for thought: https://github.com/nspec/NSpec/issues/169
And this one: https://github.com/nspec/NSpec/issues/59
It would be nice to be able to do something like the following.
For singular cases, maybe something like this:
I'm currently doing the following as a workaround, but a built in feature like above would be nice.