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

Expose LSHTTPStubURLProtocol.h & bump to 0.7.2 #54

Closed
wants to merge 1 commit into from

Conversation

timshadel
Copy link
Contributor

Helps allow users to work with NSURLSession instances, like #50.

Helps allow users to work with `NSURLSession` instances, like luisobo#50.
@jdx
Copy link

jdx commented Jan 14, 2014

works for me!

@timshadel
Copy link
Contributor Author

So just to be clear, there's no code change here, we're just ensuring that a .h file is visible to those of us that use cocoapods to bring Nocilla into our test suite. Any reason to delay this any longer? Or is it benign enough to merge and approve right now?

@luisobo
Copy link
Owner

luisobo commented Jan 15, 2014

I don't want to expose implementation details.

Check the pull request for NSURLSession hook that I open to see what I have
in mind. It will hook automatically.

I'm having some trouble swizzling a method in that PR, help will be very
much appreciated.

El miércoles, 15 de enero de 2014, Tim Shadel escribió:

So just to be clear, there's no code change here, we're just ensuring that
a .h file is visible to those of us that use cocoapods to bring Nocilla
into our test suite. Any reason to delay this any longer? Or is it benign
enough to merge and approve right now?


Reply to this email directly or view it on GitHubhttps://github.com//pull/54#issuecomment-32396201
.

@timshadel
Copy link
Contributor Author

My guess is that the problem is not the swizzling, but that the defaultSessionConfiguration is likely statically initialized with a single instance even before your test code calls it for the first time, somewhere inside Apple's code. So that means that in order to return our modified configuration we need to swizzle that method instead. I got the test passing under that theory here:

https://github.com/timshadel/Nocilla/tree/nsurlsession-hook

I've swizzled the other two class methods that looked similar to that method, but the testing didn't work off the bat.

I'm not quite sure what I think about swizzling at that level, but it seems to work. Maybe that'll help get you onto a solution that keeps the impl details hidden.

@luisobo
Copy link
Owner

luisobo commented Jan 18, 2014

Closed by #60

@luisobo luisobo closed this Jan 18, 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

Successfully merging this pull request may close these issues.

None yet

3 participants