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

Consider public access #43

Closed
ashfurrow opened this issue Aug 16, 2014 · 4 comments
Closed

Consider public access #43

ashfurrow opened this issue Aug 16, 2014 · 4 comments

Comments

@ashfurrow
Copy link

Right now, Alamofire uses the default access control qualifier, internal. Other targets in a project, such a unit tests, might want to access these internal classes, too (to make requests, for instance). I'm a bit unsure which classes, extensions, and functions should be public and which ones left internal.

Related to #42.

@mattt
Copy link
Sponsor Contributor

mattt commented Aug 17, 2014

Unit tests work just fine as-is. Are you running into any specific issue with access control?

@ashfurrow
Copy link
Author

I'm not sure how your unit tests are set up – on my project, I have the Alamofire.swift file included in my framework target, which is linked against for the unit testing target. In my framework target, I was able to access the Alamofire class, since its public, but the methods in the extensions, like request and response are internal, so I couldn't access them.

It's kind of an edge case, anyway, since I don't expect many people need Alamofire in their unit tests (I was just performing a sanity check when I ran into this problem). A possible solution would be including the Alamofire file in the unit test target, too.

@mxswd
Copy link

mxswd commented Aug 18, 2014

I would include all framework sources in the tests target instead of linking a test target against a framework. This way you can still access the internal members of the, would be, framework.

@mattt
Copy link
Sponsor Contributor

mattt commented Aug 24, 2014

As of 9f7c365, Alamofire is structured for use as a framework, rather than a drop-in file. The access control is such that the unit tests target in the provided test harness is able to successfully run all of the tests.

@mattt mattt closed this as completed Aug 24, 2014
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

No branches or pull requests

3 participants