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

Add testErrorDelegateCallbackWhenMismatchInChunkSupport #75

Merged
merged 5 commits into from
Feb 2, 2016

Conversation

8W9aG
Copy link
Contributor

@8W9aG 8W9aG commented Feb 1, 2016

  • Test that an error is thrown when the data loader
    attempts to load a request that requires chunks but
    the delegate does not support chunks
  • Removes previous assertion in favor of a less
    noisy delegate error callback approach

@8W9aG
Copy link
Contributor Author

8W9aG commented Feb 1, 2016

@rastersize @dflems @jgavris

@@ -71,9 +72,18 @@ - (void)executeDelegateBlock:(dispatch_block_t)block
{
SPTDataLoaderRequest *copiedRequest = [request copy];
id<SPTDataLoaderDelegate> delegate = self.delegate;

// Cancel the request immediately if it requires chunks and the delegate does not support that
if ([delegate respondsToSelector:@selector(dataLoaderShouldSupportChunks:)] && copiedRequest.chunks) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't you now also message the delegate in the if-statement to check if it supports chunks?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes you are totally right

@rastersize
Copy link
Contributor

Could we add a test for the happy case?

@8W9aG
Copy link
Contributor Author

8W9aG commented Feb 1, 2016

@rastersize can do

@8W9aG
Copy link
Contributor Author

8W9aG commented Feb 2, 2016

@rastersize happy case is tested in testRelayReceivedDataChunkToDelegate

* Test that an error is thrown when the data loader
attempts to load a request that requires chunks but
the delegate does not support chunks
* Removes previous assertion in favor of a less
noisy delegate error callback approach
@rastersize
Copy link
Contributor

@8W9aG Oh right, nice.

👍

8W9aG added a commit that referenced this pull request Feb 2, 2016
Add testErrorDelegateCallbackWhenMismatchInChunkSupport
@8W9aG 8W9aG merged commit 33bab5e into spotify:master Feb 2, 2016
@8W9aG 8W9aG deleted the test-error-chunks branch February 2, 2016 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants