{"action":"created","comment":{"url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/pulls/comments/41802209","id":41802209,"diff_hunk":"@@ -64,14 +64,39 @@\n   NSString *referenceImageDirectory = [self getReferenceImageDirectoryWithDefault:(@ FB_REFERENCE_IMAGE_DIR)]; \\\n   XCTAssertNotNil(referenceImageDirectory, @\"Missing value for referenceImagesDirectory - Set FB_REFERENCE_IMAGE_DIR as Environment variable in your scheme.\");\\\n   XCTAssertTrue((suffixes__.count > 0), @\"Suffixes set cannot be empty %@\", suffixes__); \\\n+  \\\n+  BOOL testSuccess__ = NO; \\\n   NSError *error__ = nil; \\\n-  BOOL comparisonSuccess__; \\\n-  for (NSString *suffix__ in suffixes__) { \\\n-    NSString *referenceImagesDirectory__ = [NSString stringWithFormat:@\"%@%@\", referenceImageDirectory, suffix__]; \\\n-    comparisonSuccess__ = [self compareSnapshotOf ## what__ :(viewOrLayer__) referenceImagesDirectory:referenceImagesDirectory__ identifier:(identifier__) tolerance:(tolerance__) error:&error__]; \\\n-    if (comparisonSuccess__ || self.recordMode) break; \\\n+  NSMutableArray *errors__ = [NSMutableArray array]; \\\n+  \\\n+  if (self.recordMode) { \\\n+    \\\n+    NSString *referenceImagesDirectory__ = [NSString stringWithFormat:@\"%@%@\", referenceImageDirectory, suffixes__.firstObject]; \\\n+    BOOL referenceImageSaved__ = [self compareSnapshotOf ## what__ :(viewOrLayer__) referenceImagesDirectory:referenceImagesDirectory__ identifier:(identifier__) tolerance:(tolerance__) error:&error__]; \\\n+    if (!referenceImageSaved__) { \\\n+      [errors__ addObject:error__]; \\\n+    } \\\n+  } else { \\\n+    \\\n+    for (NSString *suffix__ in suffixes__) { \\\n+      NSString *referenceImagesDirectory__ = [NSString stringWithFormat:@\"%@%@\", referenceImageDirectory, suffix__]; \\\n+      BOOL referenceImageAvailable = [self referenceImageRecordedInDirectory:referenceImagesDirectory__ identifier:(identifier__) error:&error__]; \\\n+      \\\n+      if (referenceImageAvailable) { \\\n+        BOOL comparisonSuccess__ = [self compareSnapshotOf ## what__ :(viewOrLayer__) referenceImagesDirectory:referenceImagesDirectory__ identifier:(identifier__) tolerance:(tolerance__) error:&error__]; \\\n+        [errors__ removeAllObjects]; \\\n+        if (comparisonSuccess__) { \\\n+          testSuccess__ = YES; \\\n+        } else { \\\n+          [errors__ addObject:error__]; \\\n+        } \\\n+        break; \\","path":"FBSnapshotTestCase/FBSnapshotTestCase.h","position":35,"original_position":35,"commit_id":"330873b3ee5da65c2075020bd44a9ba262eaf138","original_commit_id":"330873b3ee5da65c2075020bd44a9ba262eaf138","user":{"login":"nscoding","id":185995,"avatar_url":"https://avatars.githubusercontent.com/u/185995?v=3","gravatar_id":"","url":"https://api.github.com/users/nscoding","html_url":"https://github.com/nscoding","followers_url":"https://api.github.com/users/nscoding/followers","following_url":"https://api.github.com/users/nscoding/following{/other_user}","gists_url":"https://api.github.com/users/nscoding/gists{/gist_id}","starred_url":"https://api.github.com/users/nscoding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nscoding/subscriptions","organizations_url":"https://api.github.com/users/nscoding/orgs","repos_url":"https://api.github.com/users/nscoding/repos","events_url":"https://api.github.com/users/nscoding/events{/privacy}","received_events_url":"https://api.github.com/users/nscoding/received_events","type":"User","site_admin":false},"body":"Let's keep the logic for now.\r\n\r\nI propose we do a `3.0` that will actually get rid of this for loop on different suffixes and also improve the situation of the macros.","created_at":"2015-10-12T21:16:34Z","updated_at":"2015-10-12T21:16:34Z","html_url":"https://github.com/facebook/ios-snapshot-test-case/pull/119#discussion_r41802209","pull_request_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/pulls/119","_links":{"self":{"href":"https://api.github.com/repos/facebook/ios-snapshot-test-case/pulls/comments/41802209"},"html":{"href":"https://github.com/facebook/ios-snapshot-test-case/pull/119#discussion_r41802209"},"pull_request":{"href":"https://api.github.com/repos/facebook/ios-snapshot-test-case/pulls/119"}}},"pull_request":{"url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/pulls/119","id":46676709,"html_url":"https://github.com/facebook/ios-snapshot-test-case/pull/119","diff_url":"https://github.com/facebook/ios-snapshot-test-case/pull/119.diff","patch_url":"https://github.com/facebook/ios-snapshot-test-case/pull/119.patch","issue_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/issues/119","number":119,"state":"open","locked":false,"title":"Fix for issue: #102 Test incorrectly reports missing image due to default suffixes","user":{"login":"Grubas7","id":9446070,"avatar_url":"https://avatars.githubusercontent.com/u/9446070?v=3","gravatar_id":"","url":"https://api.github.com/users/Grubas7","html_url":"https://github.com/Grubas7","followers_url":"https://api.github.com/users/Grubas7/followers","following_url":"https://api.github.com/users/Grubas7/following{/other_user}","gists_url":"https://api.github.com/users/Grubas7/gists{/gist_id}","starred_url":"https://api.github.com/users/Grubas7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Grubas7/subscriptions","organizations_url":"https://api.github.com/users/Grubas7/orgs","repos_url":"https://api.github.com/users/Grubas7/repos","events_url":"https://api.github.com/users/Grubas7/events{/privacy}","received_events_url":"https://api.github.com/users/Grubas7/received_events","type":"User","site_admin":false},"body":"Fix for #102 ","created_at":"2015-10-02T20:09:51Z","updated_at":"2015-10-12T21:16:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e8c54ff79076c58e15923d1b159a2cda6ff782a8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/pulls/119/commits","review_comments_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/pulls/119/comments","review_comment_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/issues/119/comments","statuses_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/statuses/330873b3ee5da65c2075020bd44a9ba262eaf138","head":{"label":"Grubas7:master","ref":"master","sha":"330873b3ee5da65c2075020bd44a9ba262eaf138","user":{"login":"Grubas7","id":9446070,"avatar_url":"https://avatars.githubusercontent.com/u/9446070?v=3","gravatar_id":"","url":"https://api.github.com/users/Grubas7","html_url":"https://github.com/Grubas7","followers_url":"https://api.github.com/users/Grubas7/followers","following_url":"https://api.github.com/users/Grubas7/following{/other_user}","gists_url":"https://api.github.com/users/Grubas7/gists{/gist_id}","starred_url":"https://api.github.com/users/Grubas7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Grubas7/subscriptions","organizations_url":"https://api.github.com/users/Grubas7/orgs","repos_url":"https://api.github.com/users/Grubas7/repos","events_url":"https://api.github.com/users/Grubas7/events{/privacy}","received_events_url":"https://api.github.com/users/Grubas7/received_events","type":"User","site_admin":false},"repo":{"id":43390291,"name":"ios-snapshot-test-case","full_name":"Grubas7/ios-snapshot-test-case","owner":{"login":"Grubas7","id":9446070,"avatar_url":"https://avatars.githubusercontent.com/u/9446070?v=3","gravatar_id":"","url":"https://api.github.com/users/Grubas7","html_url":"https://github.com/Grubas7","followers_url":"https://api.github.com/users/Grubas7/followers","following_url":"https://api.github.com/users/Grubas7/following{/other_user}","gists_url":"https://api.github.com/users/Grubas7/gists{/gist_id}","starred_url":"https://api.github.com/users/Grubas7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Grubas7/subscriptions","organizations_url":"https://api.github.com/users/Grubas7/orgs","repos_url":"https://api.github.com/users/Grubas7/repos","events_url":"https://api.github.com/users/Grubas7/events{/privacy}","received_events_url":"https://api.github.com/users/Grubas7/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Grubas7/ios-snapshot-test-case","description":"Snapshot view unit tests for iOS","fork":true,"url":"https://api.github.com/repos/Grubas7/ios-snapshot-test-case","forks_url":"https://api.github.com/repos/Grubas7/ios-snapshot-test-case/forks","keys_url":"https://api.github.com/repos/Grubas7/ios-snapshot-test-case/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Grubas7/ios-snapshot-test-case/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Grubas7/ios-snapshot-test-case/teams","hooks_url":"https://api.github.com/repos/Grubas7/ios-snapshot-test-case/hooks","issue_events_url":"https://api.github.com/repos/Grubas7/ios-snapshot-test-case/issues/events{/number}","events_url":"https://api.github.com/repos/Grubas7/ios-snapshot-test-case/events","assignees_url":"https://api.github.com/repos/Grubas7/ios-snapshot-test-case/assignees{/user}","branches_url":"https://api.github.com/repos/Grubas7/ios-snapshot-test-case/branches{/branch}","tags_url":"https://api.github.com/repos/Grubas7/ios-snapshot-test-case/tags","blobs_url":"https://api.github.com/repos/Grubas7/ios-snapshot-test-case/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Grubas7/ios-snapshot-test-case/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Grubas7/ios-snapshot-test-case/git/refs{/sha}","trees_url":"https://api.github.com/repos/Grubas7/ios-snapshot-test-case/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Grubas7/ios-snapshot-test-case/statuses/{sha}","languages_url":"https://api.github.com/repos/Grubas7/ios-snapshot-test-case/languages","stargazers_url":"https://api.github.com/repos/Grubas7/ios-snapshot-test-case/stargazers","contributors_url":"https://api.github.com/repos/Grubas7/ios-snapshot-test-case/contributors","subscribers_url":"https://api.github.com/repos/Grubas7/ios-snapshot-test-case/subscribers","subscription_url":"https://api.github.com/repos/Grubas7/ios-snapshot-test-case/subscription","commits_url":"https://api.github.com/repos/Grubas7/ios-snapshot-test-case/commits{/sha}","git_commits_url":"https://api.github.com/repos/Grubas7/ios-snapshot-test-case/git/commits{/sha}","comments_url":"https://api.github.com/repos/Grubas7/ios-snapshot-test-case/comments{/number}","issue_comment_url":"https://api.github.com/repos/Grubas7/ios-snapshot-test-case/issues/comments{/number}","contents_url":"https://api.github.com/repos/Grubas7/ios-snapshot-test-case/contents/{+path}","compare_url":"https://api.github.com/repos/Grubas7/ios-snapshot-test-case/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Grubas7/ios-snapshot-test-case/merges","archive_url":"https://api.github.com/repos/Grubas7/ios-snapshot-test-case/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Grubas7/ios-snapshot-test-case/downloads","issues_url":"https://api.github.com/repos/Grubas7/ios-snapshot-test-case/issues{/number}","pulls_url":"https://api.github.com/repos/Grubas7/ios-snapshot-test-case/pulls{/number}","milestones_url":"https://api.github.com/repos/Grubas7/ios-snapshot-test-case/milestones{/number}","notifications_url":"https://api.github.com/repos/Grubas7/ios-snapshot-test-case/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Grubas7/ios-snapshot-test-case/labels{/name}","releases_url":"https://api.github.com/repos/Grubas7/ios-snapshot-test-case/releases{/id}","created_at":"2015-09-29T19:44:20Z","updated_at":"2015-09-29T19:44:21Z","pushed_at":"2015-10-09T19:26:55Z","git_url":"git://github.com/Grubas7/ios-snapshot-test-case.git","ssh_url":"git@github.com:Grubas7/ios-snapshot-test-case.git","clone_url":"https://github.com/Grubas7/ios-snapshot-test-case.git","svn_url":"https://github.com/Grubas7/ios-snapshot-test-case","homepage":null,"size":775,"stargazers_count":0,"watchers_count":0,"language":"Objective-C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"facebook:master","ref":"master","sha":"cf04b3036d08233654184eb533938336c57f39af","user":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"repo":{"id":13236289,"name":"ios-snapshot-test-case","full_name":"facebook/ios-snapshot-test-case","owner":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebook/ios-snapshot-test-case","description":"Snapshot view unit tests for iOS","fork":false,"url":"https://api.github.com/repos/facebook/ios-snapshot-test-case","forks_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/forks","keys_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/teams","hooks_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/hooks","issue_events_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/events","assignees_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/tags","blobs_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/languages","stargazers_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/stargazers","contributors_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/contributors","subscribers_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/subscribers","subscription_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/subscription","commits_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/merges","archive_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/downloads","issues_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/labels{/name}","releases_url":"https://api.github.com/repos/facebook/ios-snapshot-test-case/releases{/id}","created_at":"2013-10-01T06:15:56Z","updated_at":"2015-10-10T07:38:20Z","pushed_at":"2015-10-09T19:26:56Z","git_url":"git://github.com/facebook/ios-snapshot-test-case.git","ssh_url":"git@github.com:facebook/ios-snapshot-test-case.git","clone_url":"https://github.com/facebook/ios-snapshot-test-case.git","svn_url":"https://github.com/facebook/ios-snapshot-test-case","homepage":null,"size":1742,"stargazers_count":1469,"watchers_count":1469,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":126,"mirror_url":null,"open_issues_count":5,"forks":126,"open_issues":5,"watchers":1469,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/ios-snapshot-test-case/pulls/119"},"html":{"href":"https://github.com/facebook/ios-snapshot-test-case/pull/119"},"issue":{"href":"https://api.github.com/repos/facebook/ios-snapshot-test-case/issues/119"},"comments":{"href":"https://api.github.com/repos/facebook/ios-snapshot-test-case/issues/119/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/ios-snapshot-test-case/pulls/119/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/ios-snapshot-test-case/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/ios-snapshot-test-case/pulls/119/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/ios-snapshot-test-case/statuses/330873b3ee5da65c2075020bd44a9ba262eaf138"}}}}