GithubHelp home page GithubHelp logo

Comments (14)

modocache avatar modocache commented on May 23, 2024

+1, I think it'd be interesting to explore whether this is possible. Simply wrapping async functionality in XCTest might more stable, in the long run, than re-inventing that functionality in Nimble.

from nimble.

paulyoung avatar paulyoung commented on May 23, 2024

When considering test frameworks I've always thought it a plus when the default stuff was used under the hood.

from nimble.

jeffh avatar jeffh commented on May 23, 2024

Last time I checked those methods work only if you're directly inside the test case, that would mean you would need to pass self (the test case instance) through nimble explicitly.

from nimble.

paulyoung avatar paulyoung commented on May 23, 2024

I can confirm that self.expectationWithDescription and self.waitForExpectationsWithTimeout is required to use those methods inside of a QuickSpec.

from nimble.

jeffh avatar jeffh commented on May 23, 2024

That would require strange syntax to achieve properly in Nimble like:

expect(1).toEventually(equal(2), self)

Without some hackery or coordination with Quick (esp with shared examples).

I see using a implementation under the hood when appropriate. It can be a negative since it's tightly coupling to an external dependency. See Kiwi, Specta, and Cedar - which Xcode 6 test bundle support is in flux because of internal changes Apple has made. Using private APIs is a requirement if you want to do anything beyond what Apple conservatively exposes. I rather have something that doesn't support the latest wizbang feature from Apple instead of not working at all. But maybe my risk-factor is different from yours.

from nimble.

jeffh avatar jeffh commented on May 23, 2024

I'm going to close this issue for now unless something changes in APIs or someone comes up with a good solution that doesn't require a major change in the general syntax. Using the public stuff would be great if possible.

from nimble.

tonyxiao avatar tonyxiao commented on May 23, 2024

any updates 2 years later? :)

from nimble.

modocache avatar modocache commented on May 23, 2024

Nope! Same as before: expect(...).toEventually(...) provides a better API that isn't coupled to _XCTCurrentTestCase being set, or any of the other internal chicanery of XCTest. My original comment, in 2014, was wrong: rolling our own solution in Nimble has proven far more stable than interoperating with XCTest. Our async functionality continues to work, even on Linux, with no source code changes.

Thanks for the follow up, though! It's fun looking back on this decision, especially since I think we made the right one here. :)

from nimble.

modocache avatar modocache commented on May 23, 2024

@tonyxiao Is there something that you're missing from expect(...).toEventually(...), or some functionality that exists in XCTestExpectation but not in our API?

from nimble.

tonyxiao avatar tonyxiao commented on May 23, 2024

@modocache not specifically. I liked the fact that XCTestExpectation seems explicit about promises being fulfilled whereas expect(...).toEventually(...) repeatedly checks value until expectation satisfies. Not sure how much difference that actually makes in every day usage.

from nimble.

modocache avatar modocache commented on May 23, 2024

XCTestCase's wait for expectations method does pretty much the same thing, waiting for any outstanding expectations to be fulfilled. It is nice that you can call it once to wait for all expectations. On the other hand, you can't wait for individual expectations. 
We could build an API that mirrors the XCTestExpectation pattern... but I prefer Nimble's individual expectation API, so I'm in no hurry to build something like that. :)

On Fri, Jul 1, 2016 at 5:42 PM -0400, "tonyxiao" [email protected] wrote:

@modocache not specifically. I liked the fact that XCTestExpectation seems explicit about promises being fulfilled whereas expect(...).toEventually(...) repeatedly checks value until expectation satisfies. Not sure how much difference that actually makes in every day usage.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

from nimble.

tonyxiao avatar tonyxiao commented on May 23, 2024

Got it. Thank you for the clarification!

from nimble.

tonyxiao avatar tonyxiao commented on May 23, 2024

What about performance testing btw? Does Quick have something equivalent to measureBlock?

from nimble.

iDevPro avatar iDevPro commented on May 23, 2024

how to "expect(...).toEventually("ManyEquals here")" ?)

from nimble.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.