GitHub PullRequestReviewCommentEvent at 2014-07-23 01:43:12
Repository: hound
Actor: houndci
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/thoughtbot/hound/pulls/comments/15267705","id":15267705,"diff_hunk":"@@ -3,97 +3,114 @@\n require 'app/models/commit_file'\n require 'app/models/patch'\n \n-describe CommitFile, '#relevant_line?' do\n-  let(:commit_file) { CommitFile.new(double(:file, patch: ''), '') }\n+describe CommitFile do\n+  describe \"#relevant_line?\" do\n+    context 'when line is modified' do\n+      it 'returns true' do\n+        modified_line = double(:modified_line, line_number: 1)\n+        patch = double(:patch, additions: [modified_line])\n+        Patch.stub(new: patch)\n+\n+        result = commit_file.relevant_line?(1)\n+\n+        expect(result).to be_true\n+      end\n+    end\n \n-  context 'when line is modified' do\n-    it 'returns true' do\n-      modified_line = double(:modified_line, line_number: 1)\n-      patch = double(:patch, additions: [modified_line])\n-      Patch.stub(new: patch)\n+    context 'when line is not modified' do\n+      it 'returns false' do\n+        modified_line = double(:modified_line, line_number: 1)\n+        patch = double(:patch, additions: [modified_line])\n+        Patch.stub(new: patch)\n \n-      result = commit_file.relevant_line?(1)\n+        result = commit_file.relevant_line?(2)\n \n-      expect(result).to be_true\n+        expect(result).to be_false\n+      end\n     end\n   end\n \n-  context 'when line is not modified' do\n-    it 'returns false' do\n-      modified_line = double(:modified_line, line_number: 1)\n-      patch = double(:patch, additions: [modified_line])\n-      Patch.stub(new: patch)\n+  describe '#removed?' do\n+    context 'when status is removed' do\n+      it 'returns true' do\n+        commit_file = commit_file(status: \"removed\")\n+\n+        expect(commit_file).to be_removed\n+      end\n+    end\n \n-      result = commit_file.relevant_line?(2)\n+    context 'when status is added' do","path":"spec/models/commit_file_spec.rb","position":55,"original_position":55,"commit_id":"984f3ecb10b9987f1a31c26d029fabff0750bd8d","original_commit_id":"984f3ecb10b9987f1a31c26d029fabff0750bd8d","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?","gravatar_id":"38d9cefd9971a05bf447f07c6cd332cc","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.","created_at":"2014-07-23T01:43:12Z","updated_at":"2014-07-23T01:43:12Z","html_url":"https://github.com/thoughtbot/hound/pull/324#discussion_r15267705","pull_request_url":"https://api.github.com/repos/thoughtbot/hound/pulls/324","_links":{"self":{"href":"https://api.github.com/repos/thoughtbot/hound/pulls/comments/15267705"},"html":{"href":"https://github.com/thoughtbot/hound/pull/324#discussion_r15267705"},"pull_request":{"href":"https://api.github.com/repos/thoughtbot/hound/pulls/324"}}},"pull_request":{"url":"https://api.github.com/repos/thoughtbot/hound/pulls/324","id":18752766,"html_url":"https://github.com/thoughtbot/hound/pull/324","diff_url":"https://github.com/thoughtbot/hound/pull/324.diff","patch_url":"https://github.com/thoughtbot/hound/pull/324.patch","issue_url":"https://api.github.com/repos/thoughtbot/hound/issues/324","number":324,"state":"open","title":"Defer getting file contents until needed","user":{"login":"gylaz","id":116327,"avatar_url":"https://avatars.githubusercontent.com/u/116327?","gravatar_id":"054aeaa0b4f25d33c231baeae1e16123","url":"https://api.github.com/users/gylaz","html_url":"https://github.com/gylaz","followers_url":"https://api.github.com/users/gylaz/followers","following_url":"https://api.github.com/users/gylaz/following{/other_user}","gists_url":"https://api.github.com/users/gylaz/gists{/gist_id}","starred_url":"https://api.github.com/users/gylaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gylaz/subscriptions","organizations_url":"https://api.github.com/users/gylaz/orgs","repos_url":"https://api.github.com/users/gylaz/repos","events_url":"https://api.github.com/users/gylaz/events{/privacy}","received_events_url":"https://api.github.com/users/gylaz/received_events","type":"User","site_admin":false},"body":"This will avoid calling the API to get file contents from GitHub as the\r\n`CommitFile` object is constructed. Also, allows us to avoid getting contents if\r\nfile is removed.","created_at":"2014-07-23T01:43:04Z","updated_at":"2014-07-23T01:43:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f0a5ba4e69bf97af99a47522c5312a89e96bcadc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/thoughtbot/hound/pulls/324/commits","review_comments_url":"https://api.github.com/repos/thoughtbot/hound/pulls/324/comments","review_comment_url":"https://api.github.com/repos/thoughtbot/hound/pulls/comments/{number}","comments_url":"https://api.github.com/repos/thoughtbot/hound/issues/324/comments","statuses_url":"https://api.github.com/repos/thoughtbot/hound/statuses/984f3ecb10b9987f1a31c26d029fabff0750bd8d","head":{"label":"thoughtbot:gl-ignore-removed-files","ref":"gl-ignore-removed-files","sha":"984f3ecb10b9987f1a31c26d029fabff0750bd8d","user":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?","gravatar_id":"a95a04df2dae60397c38c9bd04492c53","url":"https://api.github.com/users/thoughtbot","html_url":"https://github.com/thoughtbot","followers_url":"https://api.github.com/users/thoughtbot/followers","following_url":"https://api.github.com/users/thoughtbot/following{/other_user}","gists_url":"https://api.github.com/users/thoughtbot/gists{/gist_id}","starred_url":"https://api.github.com/users/thoughtbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thoughtbot/subscriptions","organizations_url":"https://api.github.com/users/thoughtbot/orgs","repos_url":"https://api.github.com/users/thoughtbot/repos","events_url":"https://api.github.com/users/thoughtbot/events{/privacy}","received_events_url":"https://api.github.com/users/thoughtbot/received_events","type":"Organization","site_admin":false},"repo":{"id":7411076,"name":"hound","full_name":"thoughtbot/hound","owner":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?","gravatar_id":"a95a04df2dae60397c38c9bd04492c53","url":"https://api.github.com/users/thoughtbot","html_url":"https://github.com/thoughtbot","followers_url":"https://api.github.com/users/thoughtbot/followers","following_url":"https://api.github.com/users/thoughtbot/following{/other_user}","gists_url":"https://api.github.com/users/thoughtbot/gists{/gist_id}","starred_url":"https://api.github.com/users/thoughtbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thoughtbot/subscriptions","organizations_url":"https://api.github.com/users/thoughtbot/orgs","repos_url":"https://api.github.com/users/thoughtbot/repos","events_url":"https://api.github.com/users/thoughtbot/events{/privacy}","received_events_url":"https://api.github.com/users/thoughtbot/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/thoughtbot/hound","description":"Take care of pesky code reviews with a trusty Hound.","fork":false,"url":"https://api.github.com/repos/thoughtbot/hound","forks_url":"https://api.github.com/repos/thoughtbot/hound/forks","keys_url":"https://api.github.com/repos/thoughtbot/hound/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thoughtbot/hound/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thoughtbot/hound/teams","hooks_url":"https://api.github.com/repos/thoughtbot/hound/hooks","issue_events_url":"https://api.github.com/repos/thoughtbot/hound/issues/events{/number}","events_url":"https://api.github.com/repos/thoughtbot/hound/events","assignees_url":"https://api.github.com/repos/thoughtbot/hound/assignees{/user}","branches_url":"https://api.github.com/repos/thoughtbot/hound/branches{/branch}","tags_url":"https://api.github.com/repos/thoughtbot/hound/tags","blobs_url":"https://api.github.com/repos/thoughtbot/hound/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thoughtbot/hound/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thoughtbot/hound/git/refs{/sha}","trees_url":"https://api.github.com/repos/thoughtbot/hound/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thoughtbot/hound/statuses/{sha}","languages_url":"https://api.github.com/repos/thoughtbot/hound/languages","stargazers_url":"https://api.github.com/repos/thoughtbot/hound/stargazers","contributors_url":"https://api.github.com/repos/thoughtbot/hound/contributors","subscribers_url":"https://api.github.com/repos/thoughtbot/hound/subscribers","subscription_url":"https://api.github.com/repos/thoughtbot/hound/subscription","commits_url":"https://api.github.com/repos/thoughtbot/hound/commits{/sha}","git_commits_url":"https://api.github.com/repos/thoughtbot/hound/git/commits{/sha}","comments_url":"https://api.github.com/repos/thoughtbot/hound/comments{/number}","issue_comment_url":"https://api.github.com/repos/thoughtbot/hound/issues/comments/{number}","contents_url":"https://api.github.com/repos/thoughtbot/hound/contents/{+path}","compare_url":"https://api.github.com/repos/thoughtbot/hound/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thoughtbot/hound/merges","archive_url":"https://api.github.com/repos/thoughtbot/hound/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thoughtbot/hound/downloads","issues_url":"https://api.github.com/repos/thoughtbot/hound/issues{/number}","pulls_url":"https://api.github.com/repos/thoughtbot/hound/pulls{/number}","milestones_url":"https://api.github.com/repos/thoughtbot/hound/milestones{/number}","notifications_url":"https://api.github.com/repos/thoughtbot/hound/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thoughtbot/hound/labels{/name}","releases_url":"https://api.github.com/repos/thoughtbot/hound/releases{/id}","created_at":"2013-01-02T18:12:40Z","updated_at":"2014-07-22T20:52:08Z","pushed_at":"2014-07-23T01:42:35Z","git_url":"git://github.com/thoughtbot/hound.git","ssh_url":"git@github.com:thoughtbot/hound.git","clone_url":"https://github.com/thoughtbot/hound.git","svn_url":"https://github.com/thoughtbot/hound","homepage":"https://houndci.com","size":9917,"stargazers_count":412,"watchers_count":412,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"forks_count":56,"mirror_url":null,"open_issues_count":9,"forks":56,"open_issues":9,"watchers":412,"default_branch":"master"}},"base":{"label":"thoughtbot:master","ref":"master","sha":"b4152c54256eb9912eafed52be836028df2ad469","user":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?","gravatar_id":"a95a04df2dae60397c38c9bd04492c53","url":"https://api.github.com/users/thoughtbot","html_url":"https://github.com/thoughtbot","followers_url":"https://api.github.com/users/thoughtbot/followers","following_url":"https://api.github.com/users/thoughtbot/following{/other_user}","gists_url":"https://api.github.com/users/thoughtbot/gists{/gist_id}","starred_url":"https://api.github.com/users/thoughtbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thoughtbot/subscriptions","organizations_url":"https://api.github.com/users/thoughtbot/orgs","repos_url":"https://api.github.com/users/thoughtbot/repos","events_url":"https://api.github.com/users/thoughtbot/events{/privacy}","received_events_url":"https://api.github.com/users/thoughtbot/received_events","type":"Organization","site_admin":false},"repo":{"id":7411076,"name":"hound","full_name":"thoughtbot/hound","owner":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?","gravatar_id":"a95a04df2dae60397c38c9bd04492c53","url":"https://api.github.com/users/thoughtbot","html_url":"https://github.com/thoughtbot","followers_url":"https://api.github.com/users/thoughtbot/followers","following_url":"https://api.github.com/users/thoughtbot/following{/other_user}","gists_url":"https://api.github.com/users/thoughtbot/gists{/gist_id}","starred_url":"https://api.github.com/users/thoughtbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thoughtbot/subscriptions","organizations_url":"https://api.github.com/users/thoughtbot/orgs","repos_url":"https://api.github.com/users/thoughtbot/repos","events_url":"https://api.github.com/users/thoughtbot/events{/privacy}","received_events_url":"https://api.github.com/users/thoughtbot/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/thoughtbot/hound","description":"Take care of pesky code reviews with a trusty Hound.","fork":false,"url":"https://api.github.com/repos/thoughtbot/hound","forks_url":"https://api.github.com/repos/thoughtbot/hound/forks","keys_url":"https://api.github.com/repos/thoughtbot/hound/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thoughtbot/hound/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thoughtbot/hound/teams","hooks_url":"https://api.github.com/repos/thoughtbot/hound/hooks","issue_events_url":"https://api.github.com/repos/thoughtbot/hound/issues/events{/number}","events_url":"https://api.github.com/repos/thoughtbot/hound/events","assignees_url":"https://api.github.com/repos/thoughtbot/hound/assignees{/user}","branches_url":"https://api.github.com/repos/thoughtbot/hound/branches{/branch}","tags_url":"https://api.github.com/repos/thoughtbot/hound/tags","blobs_url":"https://api.github.com/repos/thoughtbot/hound/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thoughtbot/hound/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thoughtbot/hound/git/refs{/sha}","trees_url":"https://api.github.com/repos/thoughtbot/hound/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thoughtbot/hound/statuses/{sha}","languages_url":"https://api.github.com/repos/thoughtbot/hound/languages","stargazers_url":"https://api.github.com/repos/thoughtbot/hound/stargazers","contributors_url":"https://api.github.com/repos/thoughtbot/hound/contributors","subscribers_url":"https://api.github.com/repos/thoughtbot/hound/subscribers","subscription_url":"https://api.github.com/repos/thoughtbot/hound/subscription","commits_url":"https://api.github.com/repos/thoughtbot/hound/commits{/sha}","git_commits_url":"https://api.github.com/repos/thoughtbot/hound/git/commits{/sha}","comments_url":"https://api.github.com/repos/thoughtbot/hound/comments{/number}","issue_comment_url":"https://api.github.com/repos/thoughtbot/hound/issues/comments/{number}","contents_url":"https://api.github.com/repos/thoughtbot/hound/contents/{+path}","compare_url":"https://api.github.com/repos/thoughtbot/hound/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thoughtbot/hound/merges","archive_url":"https://api.github.com/repos/thoughtbot/hound/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thoughtbot/hound/downloads","issues_url":"https://api.github.com/repos/thoughtbot/hound/issues{/number}","pulls_url":"https://api.github.com/repos/thoughtbot/hound/pulls{/number}","milestones_url":"https://api.github.com/repos/thoughtbot/hound/milestones{/number}","notifications_url":"https://api.github.com/repos/thoughtbot/hound/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thoughtbot/hound/labels{/name}","releases_url":"https://api.github.com/repos/thoughtbot/hound/releases{/id}","created_at":"2013-01-02T18:12:40Z","updated_at":"2014-07-22T20:52:08Z","pushed_at":"2014-07-23T01:42:35Z","git_url":"git://github.com/thoughtbot/hound.git","ssh_url":"git@github.com:thoughtbot/hound.git","clone_url":"https://github.com/thoughtbot/hound.git","svn_url":"https://github.com/thoughtbot/hound","homepage":"https://houndci.com","size":9917,"stargazers_count":412,"watchers_count":412,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"forks_count":56,"mirror_url":null,"open_issues_count":9,"forks":56,"open_issues":9,"watchers":412,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/thoughtbot/hound/pulls/324"},"html":{"href":"https://github.com/thoughtbot/hound/pull/324"},"issue":{"href":"https://api.github.com/repos/thoughtbot/hound/issues/324"},"comments":{"href":"https://api.github.com/repos/thoughtbot/hound/issues/324/comments"},"review_comments":{"href":"https://api.github.com/repos/thoughtbot/hound/pulls/324/comments"},"review_comment":{"href":"https://api.github.com/repos/thoughtbot/hound/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/thoughtbot/hound/pulls/324/commits"},"statuses":{"href":"https://api.github.com/repos/thoughtbot/hound/statuses/984f3ecb10b9987f1a31c26d029fabff0750bd8d"}}}}