{"action":"created","comment":{"url":"https://api.github.com/repos/seattlerb/minitest/pulls/comments/41918357","id":41918357,"diff_hunk":"@@ -343,6 +339,30 @@ def test_mock_called_via_send_with_args\n     mock.verify\n   end\n \n+  def test_mock_was_called_x_times\n+    mock = Minitest::Mock.new\n+    mock.expect(:foo, true, [], times: 2)\n+\n+    mock.foo\n+    mock.foo\n+    mock.verify\n+  end\n+\n+  def test_mock_was_never_called\n+    mock = Minitest::Mock.new\n+    mock.expect(:foo, true, [], times: 0)\n+\n+    mock.verify\n+  end\n+\n+  def test_mock_blow_up_when_called_less_times\n+    @mock = Minitest::Mock.new\n+    @mock.expect(:foo, true, [], times: 2)\n+\n+    @mock.foo","path":"test/minitest/test_minitest_mock.rb","position":47,"original_position":47,"commit_id":"b700ab8e4d36a01df1d78e1b58357aeff86ef7d7","original_commit_id":"b700ab8e4d36a01df1d78e1b58357aeff86ef7d7","user":{"login":"zenspider","id":9832,"avatar_url":"https://avatars.githubusercontent.com/u/9832?v=3","gravatar_id":"","url":"https://api.github.com/users/zenspider","html_url":"https://github.com/zenspider","followers_url":"https://api.github.com/users/zenspider/followers","following_url":"https://api.github.com/users/zenspider/following{/other_user}","gists_url":"https://api.github.com/users/zenspider/gists{/gist_id}","starred_url":"https://api.github.com/users/zenspider/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zenspider/subscriptions","organizations_url":"https://api.github.com/users/zenspider/orgs","repos_url":"https://api.github.com/users/zenspider/repos","events_url":"https://api.github.com/users/zenspider/events{/privacy}","received_events_url":"https://api.github.com/users/zenspider/received_events","type":"User","site_admin":false},"body":"ditto","created_at":"2015-10-13T20:16:29Z","updated_at":"2015-10-13T20:16:29Z","html_url":"https://github.com/seattlerb/minitest/pull/588#discussion_r41918357","pull_request_url":"https://api.github.com/repos/seattlerb/minitest/pulls/588","_links":{"self":{"href":"https://api.github.com/repos/seattlerb/minitest/pulls/comments/41918357"},"html":{"href":"https://github.com/seattlerb/minitest/pull/588#discussion_r41918357"},"pull_request":{"href":"https://api.github.com/repos/seattlerb/minitest/pulls/588"}}},"pull_request":{"url":"https://api.github.com/repos/seattlerb/minitest/pulls/588","id":47474323,"html_url":"https://github.com/seattlerb/minitest/pull/588","diff_url":"https://github.com/seattlerb/minitest/pull/588.diff","patch_url":"https://github.com/seattlerb/minitest/pull/588.patch","issue_url":"https://api.github.com/repos/seattlerb/minitest/issues/588","number":588,"state":"open","locked":false,"title":"Adds option to verify the number of times a call is made","user":{"login":"zamith","id":166304,"avatar_url":"https://avatars.githubusercontent.com/u/166304?v=3","gravatar_id":"","url":"https://api.github.com/users/zamith","html_url":"https://github.com/zamith","followers_url":"https://api.github.com/users/zamith/followers","following_url":"https://api.github.com/users/zamith/following{/other_user}","gists_url":"https://api.github.com/users/zamith/gists{/gist_id}","starred_url":"https://api.github.com/users/zamith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zamith/subscriptions","organizations_url":"https://api.github.com/users/zamith/orgs","repos_url":"https://api.github.com/users/zamith/repos","events_url":"https://api.github.com/users/zamith/events{/privacy}","received_events_url":"https://api.github.com/users/zamith/received_events","type":"User","site_admin":false},"body":"Why:\r\n\r\n* It seems useful to be able to do this, especially in the situation\r\nwhere you want to verify a method is never called, because that wasn't\r\neven possible\r\n\r\nThis change addresses the need by:\r\n\r\n* Storing the expected times with the expected call\r\n* Making sure method_missing allows the call to go through when we\r\nexpect it more than once, even though we have only one record on the\r\nexpected_calls array, while also making sure it will fail if we aren't\r\nexpecting it more than once\r\n* Doing most of the work on verify, to provide a nice error when the\r\nnumber of times we expect a method to be called is not met. This is\r\nopt-in, if you do not add a times option, the verify method won't even\r\ntouch this new code\r\n\r\nAs discussed in #566.","created_at":"2015-10-12T23:07:25Z","updated_at":"2015-10-13T20:16:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b83aca273a421414e5e68b7365633021f72d8b34","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/seattlerb/minitest/pulls/588/commits","review_comments_url":"https://api.github.com/repos/seattlerb/minitest/pulls/588/comments","review_comment_url":"https://api.github.com/repos/seattlerb/minitest/pulls/comments{/number}","comments_url":"https://api.github.com/repos/seattlerb/minitest/issues/588/comments","statuses_url":"https://api.github.com/repos/seattlerb/minitest/statuses/b700ab8e4d36a01df1d78e1b58357aeff86ef7d7","head":{"label":"zamith:expect-times","ref":"expect-times","sha":"b700ab8e4d36a01df1d78e1b58357aeff86ef7d7","user":{"login":"zamith","id":166304,"avatar_url":"https://avatars.githubusercontent.com/u/166304?v=3","gravatar_id":"","url":"https://api.github.com/users/zamith","html_url":"https://github.com/zamith","followers_url":"https://api.github.com/users/zamith/followers","following_url":"https://api.github.com/users/zamith/following{/other_user}","gists_url":"https://api.github.com/users/zamith/gists{/gist_id}","starred_url":"https://api.github.com/users/zamith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zamith/subscriptions","organizations_url":"https://api.github.com/users/zamith/orgs","repos_url":"https://api.github.com/users/zamith/repos","events_url":"https://api.github.com/users/zamith/events{/privacy}","received_events_url":"https://api.github.com/users/zamith/received_events","type":"User","site_admin":false},"repo":{"id":34958099,"name":"minitest","full_name":"zamith/minitest","owner":{"login":"zamith","id":166304,"avatar_url":"https://avatars.githubusercontent.com/u/166304?v=3","gravatar_id":"","url":"https://api.github.com/users/zamith","html_url":"https://github.com/zamith","followers_url":"https://api.github.com/users/zamith/followers","following_url":"https://api.github.com/users/zamith/following{/other_user}","gists_url":"https://api.github.com/users/zamith/gists{/gist_id}","starred_url":"https://api.github.com/users/zamith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zamith/subscriptions","organizations_url":"https://api.github.com/users/zamith/orgs","repos_url":"https://api.github.com/users/zamith/repos","events_url":"https://api.github.com/users/zamith/events{/privacy}","received_events_url":"https://api.github.com/users/zamith/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zamith/minitest","description":"minitest provides a complete suite of testing facilities supporting TDD, BDD, mocking, and benchmarking.","fork":true,"url":"https://api.github.com/repos/zamith/minitest","forks_url":"https://api.github.com/repos/zamith/minitest/forks","keys_url":"https://api.github.com/repos/zamith/minitest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zamith/minitest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zamith/minitest/teams","hooks_url":"https://api.github.com/repos/zamith/minitest/hooks","issue_events_url":"https://api.github.com/repos/zamith/minitest/issues/events{/number}","events_url":"https://api.github.com/repos/zamith/minitest/events","assignees_url":"https://api.github.com/repos/zamith/minitest/assignees{/user}","branches_url":"https://api.github.com/repos/zamith/minitest/branches{/branch}","tags_url":"https://api.github.com/repos/zamith/minitest/tags","blobs_url":"https://api.github.com/repos/zamith/minitest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zamith/minitest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zamith/minitest/git/refs{/sha}","trees_url":"https://api.github.com/repos/zamith/minitest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zamith/minitest/statuses/{sha}","languages_url":"https://api.github.com/repos/zamith/minitest/languages","stargazers_url":"https://api.github.com/repos/zamith/minitest/stargazers","contributors_url":"https://api.github.com/repos/zamith/minitest/contributors","subscribers_url":"https://api.github.com/repos/zamith/minitest/subscribers","subscription_url":"https://api.github.com/repos/zamith/minitest/subscription","commits_url":"https://api.github.com/repos/zamith/minitest/commits{/sha}","git_commits_url":"https://api.github.com/repos/zamith/minitest/git/commits{/sha}","comments_url":"https://api.github.com/repos/zamith/minitest/comments{/number}","issue_comment_url":"https://api.github.com/repos/zamith/minitest/issues/comments{/number}","contents_url":"https://api.github.com/repos/zamith/minitest/contents/{+path}","compare_url":"https://api.github.com/repos/zamith/minitest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zamith/minitest/merges","archive_url":"https://api.github.com/repos/zamith/minitest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zamith/minitest/downloads","issues_url":"https://api.github.com/repos/zamith/minitest/issues{/number}","pulls_url":"https://api.github.com/repos/zamith/minitest/pulls{/number}","milestones_url":"https://api.github.com/repos/zamith/minitest/milestones{/number}","notifications_url":"https://api.github.com/repos/zamith/minitest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zamith/minitest/labels{/name}","releases_url":"https://api.github.com/repos/zamith/minitest/releases{/id}","created_at":"2015-05-02T18:07:36Z","updated_at":"2015-05-02T18:07:37Z","pushed_at":"2015-10-13T09:24:25Z","git_url":"git://github.com/zamith/minitest.git","ssh_url":"git@github.com:zamith/minitest.git","clone_url":"https://github.com/zamith/minitest.git","svn_url":"https://github.com/zamith/minitest","homepage":"http://docs.seattlerb.org/minitest/","size":1145,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"seattlerb:master","ref":"master","sha":"c674fa648550d179c3a1440bc3790350f4892b2c","user":{"login":"seattlerb","id":55277,"avatar_url":"https://avatars.githubusercontent.com/u/55277?v=3","gravatar_id":"","url":"https://api.github.com/users/seattlerb","html_url":"https://github.com/seattlerb","followers_url":"https://api.github.com/users/seattlerb/followers","following_url":"https://api.github.com/users/seattlerb/following{/other_user}","gists_url":"https://api.github.com/users/seattlerb/gists{/gist_id}","starred_url":"https://api.github.com/users/seattlerb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seattlerb/subscriptions","organizations_url":"https://api.github.com/users/seattlerb/orgs","repos_url":"https://api.github.com/users/seattlerb/repos","events_url":"https://api.github.com/users/seattlerb/events{/privacy}","received_events_url":"https://api.github.com/users/seattlerb/received_events","type":"Organization","site_admin":false},"repo":{"id":131505,"name":"minitest","full_name":"seattlerb/minitest","owner":{"login":"seattlerb","id":55277,"avatar_url":"https://avatars.githubusercontent.com/u/55277?v=3","gravatar_id":"","url":"https://api.github.com/users/seattlerb","html_url":"https://github.com/seattlerb","followers_url":"https://api.github.com/users/seattlerb/followers","following_url":"https://api.github.com/users/seattlerb/following{/other_user}","gists_url":"https://api.github.com/users/seattlerb/gists{/gist_id}","starred_url":"https://api.github.com/users/seattlerb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seattlerb/subscriptions","organizations_url":"https://api.github.com/users/seattlerb/orgs","repos_url":"https://api.github.com/users/seattlerb/repos","events_url":"https://api.github.com/users/seattlerb/events{/privacy}","received_events_url":"https://api.github.com/users/seattlerb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/seattlerb/minitest","description":"minitest provides a complete suite of testing facilities supporting TDD, BDD, mocking, and benchmarking.","fork":false,"url":"https://api.github.com/repos/seattlerb/minitest","forks_url":"https://api.github.com/repos/seattlerb/minitest/forks","keys_url":"https://api.github.com/repos/seattlerb/minitest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/seattlerb/minitest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/seattlerb/minitest/teams","hooks_url":"https://api.github.com/repos/seattlerb/minitest/hooks","issue_events_url":"https://api.github.com/repos/seattlerb/minitest/issues/events{/number}","events_url":"https://api.github.com/repos/seattlerb/minitest/events","assignees_url":"https://api.github.com/repos/seattlerb/minitest/assignees{/user}","branches_url":"https://api.github.com/repos/seattlerb/minitest/branches{/branch}","tags_url":"https://api.github.com/repos/seattlerb/minitest/tags","blobs_url":"https://api.github.com/repos/seattlerb/minitest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/seattlerb/minitest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/seattlerb/minitest/git/refs{/sha}","trees_url":"https://api.github.com/repos/seattlerb/minitest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/seattlerb/minitest/statuses/{sha}","languages_url":"https://api.github.com/repos/seattlerb/minitest/languages","stargazers_url":"https://api.github.com/repos/seattlerb/minitest/stargazers","contributors_url":"https://api.github.com/repos/seattlerb/minitest/contributors","subscribers_url":"https://api.github.com/repos/seattlerb/minitest/subscribers","subscription_url":"https://api.github.com/repos/seattlerb/minitest/subscription","commits_url":"https://api.github.com/repos/seattlerb/minitest/commits{/sha}","git_commits_url":"https://api.github.com/repos/seattlerb/minitest/git/commits{/sha}","comments_url":"https://api.github.com/repos/seattlerb/minitest/comments{/number}","issue_comment_url":"https://api.github.com/repos/seattlerb/minitest/issues/comments{/number}","contents_url":"https://api.github.com/repos/seattlerb/minitest/contents/{+path}","compare_url":"https://api.github.com/repos/seattlerb/minitest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/seattlerb/minitest/merges","archive_url":"https://api.github.com/repos/seattlerb/minitest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/seattlerb/minitest/downloads","issues_url":"https://api.github.com/repos/seattlerb/minitest/issues{/number}","pulls_url":"https://api.github.com/repos/seattlerb/minitest/pulls{/number}","milestones_url":"https://api.github.com/repos/seattlerb/minitest/milestones{/number}","notifications_url":"https://api.github.com/repos/seattlerb/minitest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/seattlerb/minitest/labels{/name}","releases_url":"https://api.github.com/repos/seattlerb/minitest/releases{/id}","created_at":"2009-02-18T07:40:21Z","updated_at":"2015-10-13T14:06:02Z","pushed_at":"2015-10-13T09:24:27Z","git_url":"git://github.com/seattlerb/minitest.git","ssh_url":"git@github.com:seattlerb/minitest.git","clone_url":"https://github.com/seattlerb/minitest.git","svn_url":"https://github.com/seattlerb/minitest","homepage":"http://docs.seattlerb.org/minitest/","size":3460,"stargazers_count":1659,"watchers_count":1659,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":295,"mirror_url":null,"open_issues_count":38,"forks":295,"open_issues":38,"watchers":1659,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/seattlerb/minitest/pulls/588"},"html":{"href":"https://github.com/seattlerb/minitest/pull/588"},"issue":{"href":"https://api.github.com/repos/seattlerb/minitest/issues/588"},"comments":{"href":"https://api.github.com/repos/seattlerb/minitest/issues/588/comments"},"review_comments":{"href":"https://api.github.com/repos/seattlerb/minitest/pulls/588/comments"},"review_comment":{"href":"https://api.github.com/repos/seattlerb/minitest/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/seattlerb/minitest/pulls/588/commits"},"statuses":{"href":"https://api.github.com/repos/seattlerb/minitest/statuses/b700ab8e4d36a01df1d78e1b58357aeff86ef7d7"}}}}