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

Make beforeEach a throws method. #1122

Closed
1 task done
tahirmt opened this issue Mar 15, 2022 · 2 comments · Fixed by #1229
Closed
1 task done

Make beforeEach a throws method. #1122

tahirmt opened this issue Mar 15, 2022 · 2 comments · Fixed by #1229
Assignees
Milestone

Comments

@tahirmt
Copy link
Contributor

tahirmt commented Mar 15, 2022

  • I have read CONTRIBUTING and have done my best to follow them.

What did you do?

I would like to be able to use throwing calls in beforeEach

beforeEach {
    let someValue = try XCTUnwrap(someOptional)
    // do something with someValue
}

What did you expect to happen?

Please replace this with what you expected to happen.

What actually happened instead?

Please replace this with what happened instead.

Environment

List the software versions you're using:

  • Quick: 4.0.0
  • Nimble: 9.2.0
  • Xcode Version: * 13.3 (13E113)* (Open Xcode; In menubar: Xcode > About Xcode)
  • Swift Version: * Xcode Default* (Open Xcode Preferences; Components > Toolchains. If none, use Xcode Default.)

Please also mention which package manager you used and its version. Delete the
other package managers in this list:

  • CocoaPods: 1.11.2 (Use pod --version in Terminal)
@jessesquires jessesquires added this to the v6.0.0 milestone Apr 19, 2022
@younata younata added enhancement and removed bug labels Sep 28, 2022
@younata younata modified the milestones: v6.0.0, v7.0.0 Oct 21, 2022
@tahirmt
Copy link
Contributor Author

tahirmt commented Jun 21, 2023

@younata any thoughts on this one? I was briefly looking into it but the hurdle I came across was that beforeEach et al functions share code with Objective-C and that breaks compatibility if we make the type a throws type. Not sure how to tackle that aside from creating objc duplicate functions.

@younata
Copy link
Member

younata commented Jun 21, 2023

@younata any thoughts on this one? I was briefly looking into it but the hurdle I came across was that beforeEach et al functions share code with Objective-C and that breaks compatibility if we make the type a throws type. Not sure how to tackle that aside from creating objc duplicate functions.

That's... more or less what I'm thinking this will require.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants