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

Documentation of how to use tags #197

Open
r-weisser opened this issue Jul 12, 2017 · 4 comments
Open

Documentation of how to use tags #197

r-weisser opened this issue Jul 12, 2017 · 4 comments

Comments

@r-weisser
Copy link

Hi, first of all - I really like exploring and diving deeper to nspec.

I'm filtering my testcases with tags which is working fine.
Right now for most cases it works to add tags in fluent description

void do_test()
{
    it["do some stuff", "label"] = () => testCase1();

    context["then something else", ""longperformancetest"] = () => 
    {
        it["testcase 2.1"] = () => case21();
        it["testcase 2.2"] = () => case22();
        it["testcase 2.3"] = () => case23();
        ...
    };
}

But I'm missing the way to associate filter tags directly to a test method.
The documentation doesn't mention tags or restrictions to them.

@BrainCrumbz
Copy link
Collaborator

BrainCrumbz commented Jul 12, 2017

Glad you like it!

I think you're right, there's no mention about that in documentation, so that's a reminder for us to fix it.

You can use the [Tag("some-tag")] attribute in order to tag:

  • whole classes:

    [Tag("some-tag")]
    public class describe_batman_sound_effects_as_text : nspec
    {
  • method-level contexts:

    public class describe_batman_sound_effects_as_text : nspec
    {
      [Tag("some-tag")]
      void they_are_loud_and_emphatic()
      {
  • method-level test specs:

    public class describe_batman_sound_effects_as_text : nspec
    {
      [Tag("some-tag")]
      void it_returns_expected_value()
      {
      }
    
      [Tag("some-tag")]
      void specify_returns_expected_value()
      {
      }

@daniel-harrison-cko
Copy link

bump.

@BrainCrumbz
Copy link
Collaborator

Hi there. Currently we (at BrainCrumbz) have no effort to put into improving this.

Are info above not sufficient to work with? If you have any specific need, post it here and we can try to give an answer to that.

Cheers

@daniel-harrison-cko
Copy link

Understood. Above information is sufficient. I'll see if I get some time to incorporate the information into the main docs.

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