Skip to content
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

Introduce the require dsl. For when you need the assertion to pass before continuing #1103

Merged
merged 12 commits into from
Dec 20, 2023

Commits on Nov 30, 2023

  1. Introduce the require-dsl. expect, but it returns the result of the e…

    …xpression
    
    As implied, this is basically a copy-paste of the functionality of expect. It's not complete, and it's not well-tested. But it gets the idea across.
    Future work is cleaning this up, backfilling tests for features (such as the unwrap function), and adding support for polling requirements (i.e. toEventually).
    
    Other than functionality, require also files the errorThrown issue type with XCTest, whereas expect files the assertionFailed issue type. This has minor differences that are mostly semantics.
    
    Also, in addition to the require dsl, this also adds unwrap, which is a shorthand for `require(...).toNot(beNil())`.
    younata committed Nov 30, 2023
    Configuration menu
    Copy the full SHA
    8a4a912 View commit details
    Browse the repository at this point in the history

Commits on Dec 12, 2023

  1. Backfill some tests for requirement

    Support async, but not yet polling.
    younata committed Dec 12, 2023
    Configuration menu
    Copy the full SHA
    5824149 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    fd7cd69 View commit details
    Browse the repository at this point in the history
  3. Support polling using require

    Oh, gosh. This is terrible. I think a cleaner way to do this would be to change MatcherResult to also store the most recent value.
    But that would be a breaking change, and might require updating existing matchers, so... no.
    younata committed Dec 12, 2023
    Configuration menu
    Copy the full SHA
    5fdf899 View commit details
    Browse the repository at this point in the history

Commits on Dec 18, 2023

  1. require should allow you to discard the result

    Rename requireAsync to requirea - matching the example set forth by expecta.
    Adds requires, which is requirea, but for specifying SyncRequirement.
    younata committed Dec 18, 2023
    Configuration menu
    Copy the full SHA
    d04e1c2 View commit details
    Browse the repository at this point in the history
  2. Document require in the README

    Update the table of contents with doctoc.
    younata committed Dec 18, 2023
    Configuration menu
    Copy the full SHA
    c629411 View commit details
    Browse the repository at this point in the history
  3. Remove AssertionHandler.require., require matcher failures will be re…

    …corded as test assertion failures, which is what they are anyway.
    younata committed Dec 18, 2023
    Configuration menu
    Copy the full SHA
    cf008d2 View commit details
    Browse the repository at this point in the history
  4. backfill tests for pollUnwrap

    Also actually mark the non-polling require dsl as discardableResult
    younata committed Dec 18, 2023
    Configuration menu
    Copy the full SHA
    40c06e9 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    d2bb507 View commit details
    Browse the repository at this point in the history
  6. Rename RequirementError to RequireError

    Fixed test failure on linux
    younata committed Dec 18, 2023
    Configuration menu
    Copy the full SHA
    e7f6804 View commit details
    Browse the repository at this point in the history

Commits on Dec 19, 2023

  1. Configuration menu
    Copy the full SHA
    3c0df24 View commit details
    Browse the repository at this point in the history
  2. Update readme TOC

    younata committed Dec 19, 2023
    Configuration menu
    Copy the full SHA
    daacce0 View commit details
    Browse the repository at this point in the history