Replies: 18 comments
-
Basically what I'm trying to avoid is writing code like this: describe("in some context") {
var metadata: ExampleMetadata?
beforeEach(closure: { (exampleMetadata) -> () in
metadata = exampleMetadata
})
it("has valid snapshot") {
/* access metadata */
}
... |
Beta Was this translation helpful? Give feedback.
-
And instead write the following: describe("in some context") {
it("doesn't care about metadata") {
...
}
it("has valid snapshot") { (exampleMetadata) -> () in
/* access exampleMetadata */
}
... |
Beta Was this translation helpful? Give feedback.
-
Totally agree. Make sure to check out the metadata being passed to before/after blocks, and use those in your PR if you can (or change them as need be to make that possible). Also, take a look at how RSpec does it--can't go wrong copying their approach. Bonus points if you also port the functionality to Objective-C! 💯 |
Beta Was this translation helpful? Give feedback.
-
I will do my best. |
Beta Was this translation helpful? Give feedback.
-
@modocache What are your thoughts on automatically supplying this information to matchers, too? |
Beta Was this translation helpful? Give feedback.
-
Not to put things off but weren't we suppose to try and build a reporter infrastructure instead of encouraging using this more temporary metadata feature? |
Beta Was this translation helpful? Give feedback.
-
I really have no horse in this race – I just want to be able to fix ashfurrow/Nimble-Snapshots#6 . It's totally possible to have a long-term plan of having a reporter infrastructure but for now I'd rather get working software. |
Beta Was this translation helpful? Give feedback.
-
@jeffh I think custom reporters are necessary to customize the output when you run Also, GitHub email response formatting ain't great. In case you missed it, @ashfurrow, this was my entire comment from earlier:
I haven't had the time to think about metadata and matchers yet, sorry--I'll comment here again later once I've given it some thought. |
Beta Was this translation helpful? Give feedback.
-
I'm sorry if I sounded too strong-willed. The first argument could also be used for async callback completion (eg - jasmine, mocha, gingko), which seems more generally useful than example metadata. But if we're not honoring any public API contracts right now I'm fine with it. |
Beta Was this translation helpful? Give feedback.
-
For the record, I still think this is worth doing--I just keep putting it on the back burner... 😶 |
Beta Was this translation helpful? Give feedback.
-
It happens – don't let it get you down! |
Beta Was this translation helpful? Give feedback.
-
What's the status on this @ashfurrow? :) |
Beta Was this translation helpful? Give feedback.
-
We were able to fix my issue without this, so it fell off my radar. I can take a look at making a PR after Labour Day. |
Beta Was this translation helpful? Give feedback.
-
Bringing attention back to this issue since it's after Labour Day. 🐱 @ashfurrow Do you have more free time these days? |
Beta Was this translation helpful? Give feedback.
-
I regret to say that I haven't had time to look at this, and likely won't until the holidays. I'll remove myself as an assignee in case someone else wants to tackle it, but I'll put a calendar reminder to look at it over xmas 👍 |
Beta Was this translation helpful? Give feedback.
-
No problem. Thanks! |
Beta Was this translation helpful? Give feedback.
-
I know I'm a little late (not xmas) but just in case you're looking for something to do during the holiday/new years season, @ashfurrow. :D No worries if not though. |
Beta Was this translation helpful? Give feedback.
-
I'm afraid I never got to this, my schedule is pretty busy coming up so I don't think I'll be able to tackle it in the near future. |
Beta Was this translation helpful? Give feedback.
-
In
it
calls, the closure should (optionally) receive example metadata in the same way thatbeforeEach
does.I don't see this being a contentious API change, and is non-breaking, so I'm going to begin work on it and get back to you with a PR for feedback.
Beta Was this translation helpful? Give feedback.
All reactions