NSpec
NSpec copied to clipboard
Persisting underscore in Assertions
context[$"processing file - \"{file.Name}\""] = () =>{}
I would like to persist the underscores in the filename so would like to escape out the underscore as follows:
context[$"processing file - \"{file.Name.Replace("_","\\")}\""] = () => {}
Any options?
Hi there. Do you mean something like this?
public class describe_underscore_in_context : nspec
{
void Given_nested_context_name_has_underscores()
{
context["This_nested_context will lose underscores"] = () =>
{
it["Should pass"] = () => true.ShouldBeTrue();
};
context["This\\_nested\\_context will keep underscores"] = () =>
{
it["Should pass"] = () => true.ShouldBeTrue();
};
}
}
There is a Conventions concept have baked in NSpec