Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persisting underscore in Assertions #195

Open
warwickfoster opened this issue Jun 29, 2017 · 2 comments
Open

Persisting underscore in Assertions #195

warwickfoster opened this issue Jun 29, 2017 · 2 comments

Comments

@warwickfoster
Copy link

warwickfoster commented Jun 29, 2017

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?

@BrainCrumbz
Copy link
Collaborator

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();
        };
    }
}

@amirrajan
Copy link
Collaborator

There is a Conventions concept have baked in NSpec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants