{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/addons-linter/pulls/comments/61569703","id":61569703,"diff_hunk":"@@ -39,6 +39,49 @@ describe('Directory.getFiles()', function() {\n \n });\n \n+describe('Directory._getPath()', function() {\n+\n+  it('should reject if not a file that exists', () => {\n+    var myDirectory = new Directory('tests/fixtures/io/');\n+    return myDirectory.getFiles()\n+      .then(() => {\n+        return myDirectory.getPath('whatever')\n+          .then(unexpectedSuccess)\n+          .catch((err) => {\n+            assert.include(\n+              err.message, '\"whatever\" does not exist in this dir.');\n+          });\n+      });\n+  });\n+\n+  it('should reject if path does not start with base', () => {\n+    var myDirectory = new Directory('tests/fixtures/io/');\n+    myDirectory.files = {\n+      '../file1.txt': {},\n+    };\n+    return myDirectory.getPath('../file1.txt')\n+      .then(unexpectedSuccess)\n+      .catch((err) => {\n+        assert.include(\n+          err.message, 'Path argument must be relative');\n+      });\n+  });\n+\n+  it(\"should reject if path starts with '/'\", () => {\n+    var myDirectory = new Directory('tests/fixtures/io/');\n+    myDirectory.files = {\n+      '/file1.txt': {},\n+    };\n+    return myDirectory.getPath('/file1.txt')\n+      .then(unexpectedSuccess)\n+      .catch((err) => {\n+        assert.include(\n+          err.message, 'Path argument must be relative');","path":"tests/io/test.directory.js","position":41,"original_position":41,"commit_id":"29335b63001a877ebdd20a7db70ce2b83a52b492","original_commit_id":"29335b63001a877ebdd20a7db70ce2b83a52b492","user":{"login":"tofumatt","id":90871,"avatar_url":"https://avatars.githubusercontent.com/u/90871?v=3","gravatar_id":"","url":"https://api.github.com/users/tofumatt","html_url":"https://github.com/tofumatt","followers_url":"https://api.github.com/users/tofumatt/followers","following_url":"https://api.github.com/users/tofumatt/following{/other_user}","gists_url":"https://api.github.com/users/tofumatt/gists{/gist_id}","starred_url":"https://api.github.com/users/tofumatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tofumatt/subscriptions","organizations_url":"https://api.github.com/users/tofumatt/orgs","repos_url":"https://api.github.com/users/tofumatt/repos","events_url":"https://api.github.com/users/tofumatt/events{/privacy}","received_events_url":"https://api.github.com/users/tofumatt/received_events","type":"User","site_admin":false},"body":"This should fit onto the previous line and be under 80 characters long.","created_at":"2016-04-29T12:35:18Z","updated_at":"2016-04-29T12:35:18Z","html_url":"https://github.com/mozilla/addons-linter/pull/632#discussion_r61569703","pull_request_url":"https://api.github.com/repos/mozilla/addons-linter/pulls/632","_links":{"self":{"href":"https://api.github.com/repos/mozilla/addons-linter/pulls/comments/61569703"},"html":{"href":"https://github.com/mozilla/addons-linter/pull/632#discussion_r61569703"},"pull_request":{"href":"https://api.github.com/repos/mozilla/addons-linter/pulls/632"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/addons-linter/pulls/632","id":68320331,"html_url":"https://github.com/mozilla/addons-linter/pull/632","diff_url":"https://github.com/mozilla/addons-linter/pull/632.diff","patch_url":"https://github.com/mozilla/addons-linter/pull/632.patch","issue_url":"https://api.github.com/repos/mozilla/addons-linter/issues/632","number":632,"state":"open","locked":false,"title":"allow getting the first chunks as a buffer","user":{"login":"andymckay","id":74699,"avatar_url":"https://avatars.githubusercontent.com/u/74699?v=3","gravatar_id":"","url":"https://api.github.com/users/andymckay","html_url":"https://github.com/andymckay","followers_url":"https://api.github.com/users/andymckay/followers","following_url":"https://api.github.com/users/andymckay/following{/other_user}","gists_url":"https://api.github.com/users/andymckay/gists{/gist_id}","starred_url":"https://api.github.com/users/andymckay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andymckay/subscriptions","organizations_url":"https://api.github.com/users/andymckay/orgs","repos_url":"https://api.github.com/users/andymckay/repos","events_url":"https://api.github.com/users/andymckay/events{/privacy}","received_events_url":"https://api.github.com/users/andymckay/received_events","type":"User","site_admin":false},"body":"* fixes #627 to help with the binary parser (which will be next)\r\n* i confess to bit of copy and paste on the tests, wondering if the could be a bit more concise","created_at":"2016-04-29T03:18:34Z","updated_at":"2016-04-29T12:35:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cf874c35cc727295415957af36dccd5bff2c3d74","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/addons-linter/pulls/632/commits","review_comments_url":"https://api.github.com/repos/mozilla/addons-linter/pulls/632/comments","review_comment_url":"https://api.github.com/repos/mozilla/addons-linter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/addons-linter/issues/632/comments","statuses_url":"https://api.github.com/repos/mozilla/addons-linter/statuses/29335b63001a877ebdd20a7db70ce2b83a52b492","head":{"label":"andymckay:read-chunk","ref":"read-chunk","sha":"29335b63001a877ebdd20a7db70ce2b83a52b492","user":{"login":"andymckay","id":74699,"avatar_url":"https://avatars.githubusercontent.com/u/74699?v=3","gravatar_id":"","url":"https://api.github.com/users/andymckay","html_url":"https://github.com/andymckay","followers_url":"https://api.github.com/users/andymckay/followers","following_url":"https://api.github.com/users/andymckay/following{/other_user}","gists_url":"https://api.github.com/users/andymckay/gists{/gist_id}","starred_url":"https://api.github.com/users/andymckay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andymckay/subscriptions","organizations_url":"https://api.github.com/users/andymckay/orgs","repos_url":"https://api.github.com/users/andymckay/repos","events_url":"https://api.github.com/users/andymckay/events{/privacy}","received_events_url":"https://api.github.com/users/andymckay/received_events","type":"User","site_admin":false},"repo":{"id":46458866,"name":"addons-validator","full_name":"andymckay/addons-validator","owner":{"login":"andymckay","id":74699,"avatar_url":"https://avatars.githubusercontent.com/u/74699?v=3","gravatar_id":"","url":"https://api.github.com/users/andymckay","html_url":"https://github.com/andymckay","followers_url":"https://api.github.com/users/andymckay/followers","following_url":"https://api.github.com/users/andymckay/following{/other_user}","gists_url":"https://api.github.com/users/andymckay/gists{/gist_id}","starred_url":"https://api.github.com/users/andymckay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andymckay/subscriptions","organizations_url":"https://api.github.com/users/andymckay/orgs","repos_url":"https://api.github.com/users/andymckay/repos","events_url":"https://api.github.com/users/andymckay/events{/privacy}","received_events_url":"https://api.github.com/users/andymckay/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andymckay/addons-validator","description":"The new Firefox Add-ons validator, written in ES6/JavaScript.","fork":true,"url":"https://api.github.com/repos/andymckay/addons-validator","forks_url":"https://api.github.com/repos/andymckay/addons-validator/forks","keys_url":"https://api.github.com/repos/andymckay/addons-validator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andymckay/addons-validator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andymckay/addons-validator/teams","hooks_url":"https://api.github.com/repos/andymckay/addons-validator/hooks","issue_events_url":"https://api.github.com/repos/andymckay/addons-validator/issues/events{/number}","events_url":"https://api.github.com/repos/andymckay/addons-validator/events","assignees_url":"https://api.github.com/repos/andymckay/addons-validator/assignees{/user}","branches_url":"https://api.github.com/repos/andymckay/addons-validator/branches{/branch}","tags_url":"https://api.github.com/repos/andymckay/addons-validator/tags","blobs_url":"https://api.github.com/repos/andymckay/addons-validator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andymckay/addons-validator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andymckay/addons-validator/git/refs{/sha}","trees_url":"https://api.github.com/repos/andymckay/addons-validator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andymckay/addons-validator/statuses/{sha}","languages_url":"https://api.github.com/repos/andymckay/addons-validator/languages","stargazers_url":"https://api.github.com/repos/andymckay/addons-validator/stargazers","contributors_url":"https://api.github.com/repos/andymckay/addons-validator/contributors","subscribers_url":"https://api.github.com/repos/andymckay/addons-validator/subscribers","subscription_url":"https://api.github.com/repos/andymckay/addons-validator/subscription","commits_url":"https://api.github.com/repos/andymckay/addons-validator/commits{/sha}","git_commits_url":"https://api.github.com/repos/andymckay/addons-validator/git/commits{/sha}","comments_url":"https://api.github.com/repos/andymckay/addons-validator/comments{/number}","issue_comment_url":"https://api.github.com/repos/andymckay/addons-validator/issues/comments{/number}","contents_url":"https://api.github.com/repos/andymckay/addons-validator/contents/{+path}","compare_url":"https://api.github.com/repos/andymckay/addons-validator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andymckay/addons-validator/merges","archive_url":"https://api.github.com/repos/andymckay/addons-validator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andymckay/addons-validator/downloads","issues_url":"https://api.github.com/repos/andymckay/addons-validator/issues{/number}","pulls_url":"https://api.github.com/repos/andymckay/addons-validator/pulls{/number}","milestones_url":"https://api.github.com/repos/andymckay/addons-validator/milestones{/number}","notifications_url":"https://api.github.com/repos/andymckay/addons-validator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andymckay/addons-validator/labels{/name}","releases_url":"https://api.github.com/repos/andymckay/addons-validator/releases{/id}","deployments_url":"https://api.github.com/repos/andymckay/addons-validator/deployments","created_at":"2015-11-19T01:23:28Z","updated_at":"2015-12-17T20:17:25Z","pushed_at":"2016-04-29T03:44:07Z","git_url":"git://github.com/andymckay/addons-validator.git","ssh_url":"git@github.com:andymckay/addons-validator.git","clone_url":"https://github.com/andymckay/addons-validator.git","svn_url":"https://github.com/andymckay/addons-validator","homepage":"","size":940,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"4d5d403b152ab30c981369bf17ee355f24d85e82","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":42436885,"name":"addons-linter","full_name":"mozilla/addons-linter","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/addons-linter","description":"The new Firefox Add-ons linter, written in ES6/JavaScript.","fork":false,"url":"https://api.github.com/repos/mozilla/addons-linter","forks_url":"https://api.github.com/repos/mozilla/addons-linter/forks","keys_url":"https://api.github.com/repos/mozilla/addons-linter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/addons-linter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/addons-linter/teams","hooks_url":"https://api.github.com/repos/mozilla/addons-linter/hooks","issue_events_url":"https://api.github.com/repos/mozilla/addons-linter/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/addons-linter/events","assignees_url":"https://api.github.com/repos/mozilla/addons-linter/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/addons-linter/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/addons-linter/tags","blobs_url":"https://api.github.com/repos/mozilla/addons-linter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/addons-linter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/addons-linter/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/addons-linter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/addons-linter/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/addons-linter/languages","stargazers_url":"https://api.github.com/repos/mozilla/addons-linter/stargazers","contributors_url":"https://api.github.com/repos/mozilla/addons-linter/contributors","subscribers_url":"https://api.github.com/repos/mozilla/addons-linter/subscribers","subscription_url":"https://api.github.com/repos/mozilla/addons-linter/subscription","commits_url":"https://api.github.com/repos/mozilla/addons-linter/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/addons-linter/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/addons-linter/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/addons-linter/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/addons-linter/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/addons-linter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/addons-linter/merges","archive_url":"https://api.github.com/repos/mozilla/addons-linter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/addons-linter/downloads","issues_url":"https://api.github.com/repos/mozilla/addons-linter/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/addons-linter/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/addons-linter/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/addons-linter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/addons-linter/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/addons-linter/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/addons-linter/deployments","created_at":"2015-09-14T08:34:44Z","updated_at":"2016-03-29T23:55:23Z","pushed_at":"2016-04-29T09:15:26Z","git_url":"git://github.com/mozilla/addons-linter.git","ssh_url":"git@github.com:mozilla/addons-linter.git","clone_url":"https://github.com/mozilla/addons-linter.git","svn_url":"https://github.com/mozilla/addons-linter","homepage":"","size":982,"stargazers_count":29,"watchers_count":29,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":10,"mirror_url":null,"open_issues_count":65,"forks":10,"open_issues":65,"watchers":29,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/addons-linter/pulls/632"},"html":{"href":"https://github.com/mozilla/addons-linter/pull/632"},"issue":{"href":"https://api.github.com/repos/mozilla/addons-linter/issues/632"},"comments":{"href":"https://api.github.com/repos/mozilla/addons-linter/issues/632/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/addons-linter/pulls/632/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/addons-linter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/addons-linter/pulls/632/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/addons-linter/statuses/29335b63001a877ebdd20a7db70ce2b83a52b492"}}}}