Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

it should receive example metadata #148

Closed
ashfurrow opened this issue Sep 29, 2014 · 18 comments
Closed

it should receive example metadata #148

ashfurrow opened this issue Sep 29, 2014 · 18 comments

Comments

@ashfurrow
Copy link
Member

In it calls, the closure should (optionally) receive example metadata in the same way that beforeEach 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.

@ashfurrow ashfurrow self-assigned this Sep 29, 2014
@ashfurrow
Copy link
Member Author

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 */
    }
...

@ashfurrow
Copy link
Member Author

And instead write the following:

describe("in some context") {    
    it("doesn't care about metadata") {
        ...
    }
    it("has valid snapshot") { (exampleMetadata) -> () in
        /* access exampleMetadata */
    }
...

@modocache
Copy link
Member

modocache commented Sep 29, 2014

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! 💯

@ashfurrow
Copy link
Member Author

I will do my best.

@ashfurrow
Copy link
Member Author

@modocache What are your thoughts on automatically supplying this information to matchers, too?

@jeffh
Copy link
Member

jeffh commented Sep 29, 2014

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?

@ashfurrow
Copy link
Member Author

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.

@modocache
Copy link
Member

@jeffh I think custom reporters are necessary to customize the output when you run xcodebuild (see issue #9). Example metadata is useful for the same reasons RSpec uses it. So as far as I've thought about it, I don't perceive there to be a feature overlap here. Let me know if you think differently.

Also, GitHub email response formatting ain't great. In case you missed it, @ashfurrow, this was my entire comment from earlier:

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! 💯

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.

@jeffh
Copy link
Member

jeffh commented Sep 30, 2014

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.

@modocache modocache added this to the v0.2.1 milestone Nov 18, 2014
@modocache modocache modified the milestones: v1.0.0, v0.3.x May 1, 2015
@modocache modocache removed this from the v1.0.0 milestone Jun 15, 2015
@modocache
Copy link
Member

For the record, I still think this is worth doing--I just keep putting it on the back burner... 😶

@ashfurrow
Copy link
Member Author

It happens – don't let it get you down!

NachoSoto pushed a commit to NachoSoto/Quick that referenced this issue Jul 18, 2016
…ns (Issue Quick#148), as well as the toNotEventually() ObjC method, which was missing
@karapigeon
Copy link

What's the status on this @ashfurrow? :)

@ashfurrow
Copy link
Member Author

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.

@karapigeon
Copy link

Bringing attention back to this issue since it's after Labour Day. 🐱 @ashfurrow Do you have more free time these days?

@ashfurrow
Copy link
Member Author

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 👍

@ashfurrow ashfurrow removed their assignment Oct 28, 2016
@karapigeon
Copy link

No problem. Thanks!

@karapigeon karapigeon self-assigned this Oct 28, 2016
@karapigeon
Copy link

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.

@ashfurrow
Copy link
Member Author

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.

@ikesyo ikesyo closed this as completed May 29, 2021
@Quick Quick locked and limited conversation to collaborators May 29, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

5 participants