-
-
Notifications
You must be signed in to change notification settings - Fork 760
Support user-supplied metadata for #its #1080
Conversation
Thanks for this, just as an FYI if we do merge this it will be extracted to the separate Also this will need a change log entry... |
@@ -52,6 +52,13 @@ Feature: User-defined metadata | |||
example.metadata[:bazz].should eq(33) | |||
example.metadata.should_not include(:foo) | |||
end | |||
|
|||
describe "has an #its example with metadata" do | |||
subject{ "foo" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finicky I know but subject { "foo" }
please.
You're welcome. I fixed the spacing. Hadn't noticed that convention. I'll add a changelog entry as well. |
@@ -43,6 +43,7 @@ Enhancements | |||
(Thomas Stratmann, Myron Marston). | |||
* Document the configuration options and default values in the `spec_helper.rb` | |||
file that is generated by RSpec (Parker Selbert). | |||
* `its` examples can have user-supplied metadata. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change logs entries usually indicate their author ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. I am obviously tired today. Sorry about the commit fest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the record we don't mind squashing and force pushing on PR's but I'm also ok with the 4 commits, I've written worse PR's!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to know! I'll leave it like this then, so I can put it in my hall of shame. Thanks.
@AlphaHydrae - thanks for the well written PR! However, my instinct is to close this w/o merging it for a few reasons:
Let me know if you have any questions/concerns about this, and thanks again for the good PR. We hope to see more contributions from you in the future. |
@myronmarston Ok, I see your point. Maybe I'll do another PR in the new gem when the time comes. I didn't know other users wanted to add arguments. That reminds me of the arguments to |
I'm working on a test analysis tool which relies heavily on user-supplied metadata such as this:
There's currently no way to add metadata to an example defined with
its
aside from wrapping it in an example group:This is very verbose when you have many
its
examples. With the changes in this commit,its
forwards additional arguments to its internaldescribe
call, allowing this: