You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature: A class/method attribute to allow for better naming #180
For the most part using void my_super_cool_context_method() works, but there are a few times where I would like to be able to use a real string to describe the context. An example would be:
The whole idea behing NSpec, for what we got, is low-to-zero ceremony. Going without attributes I guess came as a consequence of that.
I understand that this attribute would be opt-in, only if you want some not-allowed characters in your test case/context names. Still, I would go with some more descriptive naming: to keep with example, something like:
classdescribe_SomeGenericClass{voidwhen_calling_SomeMethod{context["and passing one number"]=()=>{};context["and passing two numbers"]=()=>{};}}
That goes well with the BDD/RSpec roots of this project, and makes up for a nice output with its contexts and test cases. But of course that might very well be my personal taste. Let's see if @amirrajan has any better suggestion or what else.
Final note: not sure what that "focus" attribute parameter is there for.
Lol, "focus" is another one of your undocumented features. If you add a [Tag("focus")] or a context["...", "focus"], it["...", "focus"], NSpec will only run those subset of tests. I find it useful when I'm driving out a design with tests. I was showing that [Name("...", "focus")] could also possibly support tags, but thinking about it now, you can just add the [Tag()] attribute as well.
focus and Tag are definitely "advanced" features. I'm all for support advanced features that help "perfect" a test case (either in helping author tests or read them).
@BennieCopeland 😸 right-click, Run Selected Tests is my "focus". Jokes apart, I knew about focus, you see it around in other test frameworks as well. I just didn't get suggested usage there. Thanks for clarifying!
@amirrajan what about a new [Name()] attribute like the one suggested here?
What about a new [Name()] attribute like the one suggested here?
It should be fairly straight forward to implement if @BennieCopeland wants to give it a shot. Bennie, I'd be happy to provide the touch points, video/pairing sessions, anything you need to build this feature (short of doing it myself). I think it would be a great addition. Let me know if you're interested!
On Apr 1, 2017, at 17:28, Amir Rajan ***@***.***> wrote:
What about a new [Name()] attribute like the one suggested here?
It should be fairly straight forward to implement if @BennieCopeland wants to give it a shot. Bennie, I'd be happy to provide the touch points, video/pairing sessions, anything you need to build this feature (short of doing it myself). I think it would be a great addition. Let me know if you're interested!
―
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
Activity
BrainCrumbz commentedon Mar 30, 2017
The whole idea behing NSpec, for what we got, is low-to-zero ceremony. Going without attributes I guess came as a consequence of that.
I understand that this attribute would be opt-in, only if you want some not-allowed characters in your test case/context names. Still, I would go with some more descriptive naming: to keep with example, something like:
Or, changing also structure:
That goes well with the BDD/RSpec roots of this project, and makes up for a nice output with its contexts and test cases. But of course that might very well be my personal taste. Let's see if @amirrajan has any better suggestion or what else.
Final note: not sure what that
"focus"attribute parameter is there for.BennieCopeland commentedon Mar 30, 2017
Lol,
"focus"is another one of your undocumented features. If you add a[Tag("focus")]or acontext["...", "focus"],it["...", "focus"], NSpec will only run those subset of tests. I find it useful when I'm driving out a design with tests. I was showing that[Name("...", "focus")]could also possibly support tags, but thinking about it now, you can just add the[Tag()]attribute as well.amirrajan commentedon Mar 30, 2017
focusandTagare definitely "advanced" features. I'm all for support advanced features that help "perfect" a test case (either in helping author tests or read them).GiuseppePiscopo commentedon Mar 31, 2017
@BennieCopeland 😸 right-click, Run Selected Tests is my
"focus". Jokes apart, I knew about focus, you see it around in other test frameworks as well. I just didn't get suggested usage there. Thanks for clarifying!@amirrajan what about a new
[Name()]attribute like the one suggested here?amirrajan commentedon Apr 1, 2017
It should be fairly straight forward to implement if @BennieCopeland wants to give it a shot. Bennie, I'd be happy to provide the touch points, video/pairing sessions, anything you need to build this feature (short of doing it myself). I think it would be a great addition. Let me know if you're interested!
BennieCopeland commentedon Apr 1, 2017
BrainCrumbz commentedon Apr 3, 2017
Best wishes for a speedy recovery!