Skip to content

Separate test-suite for URLProtocol #1115

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

Merged
merged 1 commit into from
Jul 17, 2017

Conversation

mamabusi
Copy link
Contributor

No description provided.

@ianpartridge
Copy link
Contributor

Can we reduce the amount of code duplication by having TestNSURLProtocol and TestURLSession inherit from a common superclass, which would itself inherit from XCTestCase?

@mamabusi
Copy link
Contributor Author

@ianpartridge Yeah, I have moved the server related code to HTTPServer file and have URLSession and URLProtocol tests inherit from there. Please have a look.
Thanks!

@@ -394,3 +396,39 @@ public class ServerSemaphore {
dispatchSemaphore.signal()
}
}

class ServerSetUp: XCTestCase {
Copy link
Member

@pushkarnk pushkarnk Jul 17, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we rename this to something like LoopbackServerTest?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, ServerSetUp is a poor name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

waitForExpectations(timeout: 12)
}

func test_protocols() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we please rename this to something like test_multipleCustomProtocols?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I have renamed it.

@mamabusi
Copy link
Contributor Author

@pushkarnk Renaming is done. Thanks for the review!

@pushkarnk
Copy link
Member

@swift-ci please test and merge

@swift-ci swift-ci merged commit 5ea6461 into swiftlang:master Jul 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants