{"action":"created","comment":{"url":"https://api.github.com/repos/elixir-lang/elixir/pulls/comments/37760552","id":37760552,"diff_hunk":"@@ -502,6 +502,26 @@ defmodule KernelTest do\n \n       assert r == 0\n     end\n+\n+    test \"calling if with invalid keys\" do\n+      assert_raise ArgumentError,\n+        \"invalid key `foo` in if, valid keys are `do` and `else`\",\n+        fn ->\n+          Code.eval_string(\"if true, foo: 7\")\n+        end\n+\n+      assert_raise ArgumentError,\n+        \"invalid key `doo` in if, valid keys are `do` and `else`\",\n+        fn ->\n+          Code.eval_string(\"if true, doo: 7, else: 6\")\n+        end\n+\n+      assert_raise ArgumentError,\n+        \"duplicate `do` key in if\",\n+      fn ->","path":"lib/elixir/test/elixir/kernel_test.exs","position":20,"original_position":20,"commit_id":"707d2b6c0e6f7ef305050aa3088e5ab9150323d3","original_commit_id":"707d2b6c0e6f7ef305050aa3088e5ab9150323d3","user":{"login":"ericmj","id":316890,"avatar_url":"https://avatars.githubusercontent.com/u/316890?v=3","gravatar_id":"","url":"https://api.github.com/users/ericmj","html_url":"https://github.com/ericmj","followers_url":"https://api.github.com/users/ericmj/followers","following_url":"https://api.github.com/users/ericmj/following{/other_user}","gists_url":"https://api.github.com/users/ericmj/gists{/gist_id}","starred_url":"https://api.github.com/users/ericmj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericmj/subscriptions","organizations_url":"https://api.github.com/users/ericmj/orgs","repos_url":"https://api.github.com/users/ericmj/repos","events_url":"https://api.github.com/users/ericmj/events{/privacy}","received_events_url":"https://api.github.com/users/ericmj/received_events","type":"User","site_admin":false},"body":"We usually bind the message to a variable and call `assert_raise` like this `assert_raise ArgumentError, message, fn -> ...` if it doesn't on one line.","created_at":"2015-08-24T15:01:22Z","updated_at":"2015-08-24T15:01:22Z","html_url":"https://github.com/elixir-lang/elixir/pull/3615#discussion_r37760552","pull_request_url":"https://api.github.com/repos/elixir-lang/elixir/pulls/3615","_links":{"self":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/comments/37760552"},"html":{"href":"https://github.com/elixir-lang/elixir/pull/3615#discussion_r37760552"},"pull_request":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/3615"}}},"pull_request":{"url":"https://api.github.com/repos/elixir-lang/elixir/pulls/3615","id":43181676,"html_url":"https://github.com/elixir-lang/elixir/pull/3615","diff_url":"https://github.com/elixir-lang/elixir/pull/3615.diff","patch_url":"https://github.com/elixir-lang/elixir/pull/3615.patch","issue_url":"https://api.github.com/repos/elixir-lang/elixir/issues/3615","number":3615,"state":"open","locked":false,"title":"fix(Kernel): check arguments on if","user":{"login":"Gazler","id":477511,"avatar_url":"https://avatars.githubusercontent.com/u/477511?v=3","gravatar_id":"","url":"https://api.github.com/users/Gazler","html_url":"https://github.com/Gazler","followers_url":"https://api.github.com/users/Gazler/followers","following_url":"https://api.github.com/users/Gazler/following{/other_user}","gists_url":"https://api.github.com/users/Gazler/gists{/gist_id}","starred_url":"https://api.github.com/users/Gazler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gazler/subscriptions","organizations_url":"https://api.github.com/users/Gazler/orgs","repos_url":"https://api.github.com/users/Gazler/repos","events_url":"https://api.github.com/users/Gazler/events{/privacy}","received_events_url":"https://api.github.com/users/Gazler/received_events","type":"User","site_admin":false},"body":"The following things are now checked when using `Kernel.if`:\r\n\r\n * There is only one `do` key\r\n * Only `do` and `else` keys exist\r\n\r\nAny calls to the if macro that do not satisfy these conditions raise an\r\nArgumentError.\r\n\r\nThis fixes 3 of the 5 examples posted in #3614 ","created_at":"2015-08-24T14:38:08Z","updated_at":"2015-08-24T15:01:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d5dc01aa7e12ed97adf258fb9ee1ffc37faab084","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/elixir-lang/elixir/pulls/3615/commits","review_comments_url":"https://api.github.com/repos/elixir-lang/elixir/pulls/3615/comments","review_comment_url":"https://api.github.com/repos/elixir-lang/elixir/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elixir-lang/elixir/issues/3615/comments","statuses_url":"https://api.github.com/repos/elixir-lang/elixir/statuses/707d2b6c0e6f7ef305050aa3088e5ab9150323d3","head":{"label":"Gazler:fix/if-arguments","ref":"fix/if-arguments","sha":"707d2b6c0e6f7ef305050aa3088e5ab9150323d3","user":{"login":"Gazler","id":477511,"avatar_url":"https://avatars.githubusercontent.com/u/477511?v=3","gravatar_id":"","url":"https://api.github.com/users/Gazler","html_url":"https://github.com/Gazler","followers_url":"https://api.github.com/users/Gazler/followers","following_url":"https://api.github.com/users/Gazler/following{/other_user}","gists_url":"https://api.github.com/users/Gazler/gists{/gist_id}","starred_url":"https://api.github.com/users/Gazler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gazler/subscriptions","organizations_url":"https://api.github.com/users/Gazler/orgs","repos_url":"https://api.github.com/users/Gazler/repos","events_url":"https://api.github.com/users/Gazler/events{/privacy}","received_events_url":"https://api.github.com/users/Gazler/received_events","type":"User","site_admin":false},"repo":{"id":22268933,"name":"elixir","full_name":"Gazler/elixir","owner":{"login":"Gazler","id":477511,"avatar_url":"https://avatars.githubusercontent.com/u/477511?v=3","gravatar_id":"","url":"https://api.github.com/users/Gazler","html_url":"https://github.com/Gazler","followers_url":"https://api.github.com/users/Gazler/followers","following_url":"https://api.github.com/users/Gazler/following{/other_user}","gists_url":"https://api.github.com/users/Gazler/gists{/gist_id}","starred_url":"https://api.github.com/users/Gazler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gazler/subscriptions","organizations_url":"https://api.github.com/users/Gazler/orgs","repos_url":"https://api.github.com/users/Gazler/repos","events_url":"https://api.github.com/users/Gazler/events{/privacy}","received_events_url":"https://api.github.com/users/Gazler/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Gazler/elixir","description":"Elixir is a functional, meta-programming aware language built on top of the Erlang VM. It is a dynamic language that focuses on tooling to leverage Erlang's abilities to build concurrent, distributed and fault-tolerant applications with hot code upgrades","fork":true,"url":"https://api.github.com/repos/Gazler/elixir","forks_url":"https://api.github.com/repos/Gazler/elixir/forks","keys_url":"https://api.github.com/repos/Gazler/elixir/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Gazler/elixir/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Gazler/elixir/teams","hooks_url":"https://api.github.com/repos/Gazler/elixir/hooks","issue_events_url":"https://api.github.com/repos/Gazler/elixir/issues/events{/number}","events_url":"https://api.github.com/repos/Gazler/elixir/events","assignees_url":"https://api.github.com/repos/Gazler/elixir/assignees{/user}","branches_url":"https://api.github.com/repos/Gazler/elixir/branches{/branch}","tags_url":"https://api.github.com/repos/Gazler/elixir/tags","blobs_url":"https://api.github.com/repos/Gazler/elixir/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Gazler/elixir/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Gazler/elixir/git/refs{/sha}","trees_url":"https://api.github.com/repos/Gazler/elixir/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Gazler/elixir/statuses/{sha}","languages_url":"https://api.github.com/repos/Gazler/elixir/languages","stargazers_url":"https://api.github.com/repos/Gazler/elixir/stargazers","contributors_url":"https://api.github.com/repos/Gazler/elixir/contributors","subscribers_url":"https://api.github.com/repos/Gazler/elixir/subscribers","subscription_url":"https://api.github.com/repos/Gazler/elixir/subscription","commits_url":"https://api.github.com/repos/Gazler/elixir/commits{/sha}","git_commits_url":"https://api.github.com/repos/Gazler/elixir/git/commits{/sha}","comments_url":"https://api.github.com/repos/Gazler/elixir/comments{/number}","issue_comment_url":"https://api.github.com/repos/Gazler/elixir/issues/comments{/number}","contents_url":"https://api.github.com/repos/Gazler/elixir/contents/{+path}","compare_url":"https://api.github.com/repos/Gazler/elixir/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Gazler/elixir/merges","archive_url":"https://api.github.com/repos/Gazler/elixir/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Gazler/elixir/downloads","issues_url":"https://api.github.com/repos/Gazler/elixir/issues{/number}","pulls_url":"https://api.github.com/repos/Gazler/elixir/pulls{/number}","milestones_url":"https://api.github.com/repos/Gazler/elixir/milestones{/number}","notifications_url":"https://api.github.com/repos/Gazler/elixir/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Gazler/elixir/labels{/name}","releases_url":"https://api.github.com/repos/Gazler/elixir/releases{/id}","created_at":"2014-07-25T19:52:28Z","updated_at":"2015-05-25T15:54:09Z","pushed_at":"2015-08-24T14:36:03Z","git_url":"git://github.com/Gazler/elixir.git","ssh_url":"git@github.com:Gazler/elixir.git","clone_url":"https://github.com/Gazler/elixir.git","svn_url":"https://github.com/Gazler/elixir","homepage":"http://elixir-lang.org/","size":29117,"stargazers_count":0,"watchers_count":0,"language":"Elixir","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":0,"default_branch":"master"}},"base":{"label":"elixir-lang:master","ref":"master","sha":"d7ebb2a2bc2ce9827b3760ca81204c1b8377b1a7","user":{"login":"elixir-lang","id":1481354,"avatar_url":"https://avatars.githubusercontent.com/u/1481354?v=3","gravatar_id":"","url":"https://api.github.com/users/elixir-lang","html_url":"https://github.com/elixir-lang","followers_url":"https://api.github.com/users/elixir-lang/followers","following_url":"https://api.github.com/users/elixir-lang/following{/other_user}","gists_url":"https://api.github.com/users/elixir-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/elixir-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elixir-lang/subscriptions","organizations_url":"https://api.github.com/users/elixir-lang/orgs","repos_url":"https://api.github.com/users/elixir-lang/repos","events_url":"https://api.github.com/users/elixir-lang/events{/privacy}","received_events_url":"https://api.github.com/users/elixir-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":1234714,"name":"elixir","full_name":"elixir-lang/elixir","owner":{"login":"elixir-lang","id":1481354,"avatar_url":"https://avatars.githubusercontent.com/u/1481354?v=3","gravatar_id":"","url":"https://api.github.com/users/elixir-lang","html_url":"https://github.com/elixir-lang","followers_url":"https://api.github.com/users/elixir-lang/followers","following_url":"https://api.github.com/users/elixir-lang/following{/other_user}","gists_url":"https://api.github.com/users/elixir-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/elixir-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elixir-lang/subscriptions","organizations_url":"https://api.github.com/users/elixir-lang/orgs","repos_url":"https://api.github.com/users/elixir-lang/repos","events_url":"https://api.github.com/users/elixir-lang/events{/privacy}","received_events_url":"https://api.github.com/users/elixir-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elixir-lang/elixir","description":"Elixir is a dynamic, functional language designed for building scalable and maintainable applications","fork":false,"url":"https://api.github.com/repos/elixir-lang/elixir","forks_url":"https://api.github.com/repos/elixir-lang/elixir/forks","keys_url":"https://api.github.com/repos/elixir-lang/elixir/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elixir-lang/elixir/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elixir-lang/elixir/teams","hooks_url":"https://api.github.com/repos/elixir-lang/elixir/hooks","issue_events_url":"https://api.github.com/repos/elixir-lang/elixir/issues/events{/number}","events_url":"https://api.github.com/repos/elixir-lang/elixir/events","assignees_url":"https://api.github.com/repos/elixir-lang/elixir/assignees{/user}","branches_url":"https://api.github.com/repos/elixir-lang/elixir/branches{/branch}","tags_url":"https://api.github.com/repos/elixir-lang/elixir/tags","blobs_url":"https://api.github.com/repos/elixir-lang/elixir/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elixir-lang/elixir/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elixir-lang/elixir/git/refs{/sha}","trees_url":"https://api.github.com/repos/elixir-lang/elixir/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elixir-lang/elixir/statuses/{sha}","languages_url":"https://api.github.com/repos/elixir-lang/elixir/languages","stargazers_url":"https://api.github.com/repos/elixir-lang/elixir/stargazers","contributors_url":"https://api.github.com/repos/elixir-lang/elixir/contributors","subscribers_url":"https://api.github.com/repos/elixir-lang/elixir/subscribers","subscription_url":"https://api.github.com/repos/elixir-lang/elixir/subscription","commits_url":"https://api.github.com/repos/elixir-lang/elixir/commits{/sha}","git_commits_url":"https://api.github.com/repos/elixir-lang/elixir/git/commits{/sha}","comments_url":"https://api.github.com/repos/elixir-lang/elixir/comments{/number}","issue_comment_url":"https://api.github.com/repos/elixir-lang/elixir/issues/comments{/number}","contents_url":"https://api.github.com/repos/elixir-lang/elixir/contents/{+path}","compare_url":"https://api.github.com/repos/elixir-lang/elixir/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elixir-lang/elixir/merges","archive_url":"https://api.github.com/repos/elixir-lang/elixir/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elixir-lang/elixir/downloads","issues_url":"https://api.github.com/repos/elixir-lang/elixir/issues{/number}","pulls_url":"https://api.github.com/repos/elixir-lang/elixir/pulls{/number}","milestones_url":"https://api.github.com/repos/elixir-lang/elixir/milestones{/number}","notifications_url":"https://api.github.com/repos/elixir-lang/elixir/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elixir-lang/elixir/labels{/name}","releases_url":"https://api.github.com/repos/elixir-lang/elixir/releases{/id}","created_at":"2011-01-09T08:43:57Z","updated_at":"2015-08-24T10:55:05Z","pushed_at":"2015-08-24T14:38:12Z","git_url":"git://github.com/elixir-lang/elixir.git","ssh_url":"git@github.com:elixir-lang/elixir.git","clone_url":"https://github.com/elixir-lang/elixir.git","svn_url":"https://github.com/elixir-lang/elixir","homepage":"http://elixir-lang.org/","size":49553,"stargazers_count":4580,"watchers_count":4580,"language":"Elixir","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":633,"mirror_url":null,"open_issues_count":34,"forks":633,"open_issues":34,"watchers":4580,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/3615"},"html":{"href":"https://github.com/elixir-lang/elixir/pull/3615"},"issue":{"href":"https://api.github.com/repos/elixir-lang/elixir/issues/3615"},"comments":{"href":"https://api.github.com/repos/elixir-lang/elixir/issues/3615/comments"},"review_comments":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/3615/comments"},"review_comment":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/3615/commits"},"statuses":{"href":"https://api.github.com/repos/elixir-lang/elixir/statuses/707d2b6c0e6f7ef305050aa3088e5ab9150323d3"}}}}