{"action":"created","comment":{"url":"https://api.github.com/repos/rspec/rspec-mocks/pulls/comments/49797312","id":49797312,"diff_hunk":"@@ -30,7 +30,7 @@ def invocation_order\n             :with => [nil],\n             :and_return => [:with, nil],\n             :and_raise => [:with, nil],\n-            :and_yield => [:with, nil],\n+            :and_yield => [:with, :and_yield, nil],","path":"lib/rspec/mocks/any_instance/stub_chain.rb","position":5,"original_position":5,"commit_id":"0e1b36f2ebf2a4a479bd8fbaeadfa245825d01f9","original_commit_id":"0e1b36f2ebf2a4a479bd8fbaeadfa245825d01f9","user":{"login":"JonRowe","id":162976,"avatar_url":"https://avatars.githubusercontent.com/u/162976?v=3","gravatar_id":"","url":"https://api.github.com/users/JonRowe","html_url":"https://github.com/JonRowe","followers_url":"https://api.github.com/users/JonRowe/followers","following_url":"https://api.github.com/users/JonRowe/following{/other_user}","gists_url":"https://api.github.com/users/JonRowe/gists{/gist_id}","starred_url":"https://api.github.com/users/JonRowe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JonRowe/subscriptions","organizations_url":"https://api.github.com/users/JonRowe/orgs","repos_url":"https://api.github.com/users/JonRowe/repos","events_url":"https://api.github.com/users/JonRowe/events{/privacy}","received_events_url":"https://api.github.com/users/JonRowe/received_events","type":"User","site_admin":false},"body":"I'm not sure this is the way to fix this, other combinations would cause the same error as before, we need to return `self` from all the method calls that support further chaining I think.","created_at":"2016-01-14T22:44:44Z","updated_at":"2016-01-14T22:44:44Z","html_url":"https://github.com/rspec/rspec-mocks/pull/1054#discussion_r49797312","pull_request_url":"https://api.github.com/repos/rspec/rspec-mocks/pulls/1054","_links":{"self":{"href":"https://api.github.com/repos/rspec/rspec-mocks/pulls/comments/49797312"},"html":{"href":"https://github.com/rspec/rspec-mocks/pull/1054#discussion_r49797312"},"pull_request":{"href":"https://api.github.com/repos/rspec/rspec-mocks/pulls/1054"}}},"pull_request":{"url":"https://api.github.com/repos/rspec/rspec-mocks/pulls/1054","id":56039605,"html_url":"https://github.com/rspec/rspec-mocks/pull/1054","diff_url":"https://github.com/rspec/rspec-mocks/pull/1054.diff","patch_url":"https://github.com/rspec/rspec-mocks/pull/1054.patch","issue_url":"https://api.github.com/repos/rspec/rspec-mocks/issues/1054","number":1054,"state":"open","locked":false,"title":"Chain and_yields for any_instance","user":{"login":"kiliancs","id":98786,"avatar_url":"https://avatars.githubusercontent.com/u/98786?v=3","gravatar_id":"","url":"https://api.github.com/users/kiliancs","html_url":"https://github.com/kiliancs","followers_url":"https://api.github.com/users/kiliancs/followers","following_url":"https://api.github.com/users/kiliancs/following{/other_user}","gists_url":"https://api.github.com/users/kiliancs/gists{/gist_id}","starred_url":"https://api.github.com/users/kiliancs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiliancs/subscriptions","organizations_url":"https://api.github.com/users/kiliancs/orgs","repos_url":"https://api.github.com/users/kiliancs/repos","events_url":"https://api.github.com/users/kiliancs/events{/privacy}","received_events_url":"https://api.github.com/users/kiliancs/received_events","type":"User","site_admin":false},"body":"This fixes #1025.\r\n```\r\nallow_any_instance_of(Klass).to receive(:method).and_yield(1).and_yield(2)\r\n```\r\nnow behaves as expected, instead of raising `NoMethodError: Undefined method and_yield`.","created_at":"2016-01-14T14:14:20Z","updated_at":"2016-01-14T22:44:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fa25a5800de5ed7cc88c36bd8faa6e1975f5363c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rspec/rspec-mocks/pulls/1054/commits","review_comments_url":"https://api.github.com/repos/rspec/rspec-mocks/pulls/1054/comments","review_comment_url":"https://api.github.com/repos/rspec/rspec-mocks/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rspec/rspec-mocks/issues/1054/comments","statuses_url":"https://api.github.com/repos/rspec/rspec-mocks/statuses/0e1b36f2ebf2a4a479bd8fbaeadfa245825d01f9","head":{"label":"kiliancs:any_instance_multiple_yields","ref":"any_instance_multiple_yields","sha":"0e1b36f2ebf2a4a479bd8fbaeadfa245825d01f9","user":{"login":"kiliancs","id":98786,"avatar_url":"https://avatars.githubusercontent.com/u/98786?v=3","gravatar_id":"","url":"https://api.github.com/users/kiliancs","html_url":"https://github.com/kiliancs","followers_url":"https://api.github.com/users/kiliancs/followers","following_url":"https://api.github.com/users/kiliancs/following{/other_user}","gists_url":"https://api.github.com/users/kiliancs/gists{/gist_id}","starred_url":"https://api.github.com/users/kiliancs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiliancs/subscriptions","organizations_url":"https://api.github.com/users/kiliancs/orgs","repos_url":"https://api.github.com/users/kiliancs/repos","events_url":"https://api.github.com/users/kiliancs/events{/privacy}","received_events_url":"https://api.github.com/users/kiliancs/received_events","type":"User","site_admin":false},"repo":{"id":49647877,"name":"rspec-mocks","full_name":"kiliancs/rspec-mocks","owner":{"login":"kiliancs","id":98786,"avatar_url":"https://avatars.githubusercontent.com/u/98786?v=3","gravatar_id":"","url":"https://api.github.com/users/kiliancs","html_url":"https://github.com/kiliancs","followers_url":"https://api.github.com/users/kiliancs/followers","following_url":"https://api.github.com/users/kiliancs/following{/other_user}","gists_url":"https://api.github.com/users/kiliancs/gists{/gist_id}","starred_url":"https://api.github.com/users/kiliancs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiliancs/subscriptions","organizations_url":"https://api.github.com/users/kiliancs/orgs","repos_url":"https://api.github.com/users/kiliancs/repos","events_url":"https://api.github.com/users/kiliancs/events{/privacy}","received_events_url":"https://api.github.com/users/kiliancs/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kiliancs/rspec-mocks","description":"RSpec's 'test double' framework, with support for stubbing and mocking","fork":true,"url":"https://api.github.com/repos/kiliancs/rspec-mocks","forks_url":"https://api.github.com/repos/kiliancs/rspec-mocks/forks","keys_url":"https://api.github.com/repos/kiliancs/rspec-mocks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kiliancs/rspec-mocks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kiliancs/rspec-mocks/teams","hooks_url":"https://api.github.com/repos/kiliancs/rspec-mocks/hooks","issue_events_url":"https://api.github.com/repos/kiliancs/rspec-mocks/issues/events{/number}","events_url":"https://api.github.com/repos/kiliancs/rspec-mocks/events","assignees_url":"https://api.github.com/repos/kiliancs/rspec-mocks/assignees{/user}","branches_url":"https://api.github.com/repos/kiliancs/rspec-mocks/branches{/branch}","tags_url":"https://api.github.com/repos/kiliancs/rspec-mocks/tags","blobs_url":"https://api.github.com/repos/kiliancs/rspec-mocks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kiliancs/rspec-mocks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kiliancs/rspec-mocks/git/refs{/sha}","trees_url":"https://api.github.com/repos/kiliancs/rspec-mocks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kiliancs/rspec-mocks/statuses/{sha}","languages_url":"https://api.github.com/repos/kiliancs/rspec-mocks/languages","stargazers_url":"https://api.github.com/repos/kiliancs/rspec-mocks/stargazers","contributors_url":"https://api.github.com/repos/kiliancs/rspec-mocks/contributors","subscribers_url":"https://api.github.com/repos/kiliancs/rspec-mocks/subscribers","subscription_url":"https://api.github.com/repos/kiliancs/rspec-mocks/subscription","commits_url":"https://api.github.com/repos/kiliancs/rspec-mocks/commits{/sha}","git_commits_url":"https://api.github.com/repos/kiliancs/rspec-mocks/git/commits{/sha}","comments_url":"https://api.github.com/repos/kiliancs/rspec-mocks/comments{/number}","issue_comment_url":"https://api.github.com/repos/kiliancs/rspec-mocks/issues/comments{/number}","contents_url":"https://api.github.com/repos/kiliancs/rspec-mocks/contents/{+path}","compare_url":"https://api.github.com/repos/kiliancs/rspec-mocks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kiliancs/rspec-mocks/merges","archive_url":"https://api.github.com/repos/kiliancs/rspec-mocks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kiliancs/rspec-mocks/downloads","issues_url":"https://api.github.com/repos/kiliancs/rspec-mocks/issues{/number}","pulls_url":"https://api.github.com/repos/kiliancs/rspec-mocks/pulls{/number}","milestones_url":"https://api.github.com/repos/kiliancs/rspec-mocks/milestones{/number}","notifications_url":"https://api.github.com/repos/kiliancs/rspec-mocks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kiliancs/rspec-mocks/labels{/name}","releases_url":"https://api.github.com/repos/kiliancs/rspec-mocks/releases{/id}","created_at":"2016-01-14T13:10:28Z","updated_at":"2016-01-14T13:10:29Z","pushed_at":"2016-01-14T14:02:33Z","git_url":"git://github.com/kiliancs/rspec-mocks.git","ssh_url":"git@github.com:kiliancs/rspec-mocks.git","clone_url":"https://github.com/kiliancs/rspec-mocks.git","svn_url":"https://github.com/kiliancs/rspec-mocks","homepage":"http://relishapp.com/rspec/rspec-mocks","size":7479,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":false,"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":"rspec:master","ref":"master","sha":"42ef957e0af1813c0933f29588121e78fadb8244","user":{"login":"rspec","id":22388,"avatar_url":"https://avatars.githubusercontent.com/u/22388?v=3","gravatar_id":"","url":"https://api.github.com/users/rspec","html_url":"https://github.com/rspec","followers_url":"https://api.github.com/users/rspec/followers","following_url":"https://api.github.com/users/rspec/following{/other_user}","gists_url":"https://api.github.com/users/rspec/gists{/gist_id}","starred_url":"https://api.github.com/users/rspec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rspec/subscriptions","organizations_url":"https://api.github.com/users/rspec/orgs","repos_url":"https://api.github.com/users/rspec/repos","events_url":"https://api.github.com/users/rspec/events{/privacy}","received_events_url":"https://api.github.com/users/rspec/received_events","type":"Organization","site_admin":false},"repo":{"id":238983,"name":"rspec-mocks","full_name":"rspec/rspec-mocks","owner":{"login":"rspec","id":22388,"avatar_url":"https://avatars.githubusercontent.com/u/22388?v=3","gravatar_id":"","url":"https://api.github.com/users/rspec","html_url":"https://github.com/rspec","followers_url":"https://api.github.com/users/rspec/followers","following_url":"https://api.github.com/users/rspec/following{/other_user}","gists_url":"https://api.github.com/users/rspec/gists{/gist_id}","starred_url":"https://api.github.com/users/rspec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rspec/subscriptions","organizations_url":"https://api.github.com/users/rspec/orgs","repos_url":"https://api.github.com/users/rspec/repos","events_url":"https://api.github.com/users/rspec/events{/privacy}","received_events_url":"https://api.github.com/users/rspec/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rspec/rspec-mocks","description":"RSpec's 'test double' framework, with support for stubbing and mocking","fork":false,"url":"https://api.github.com/repos/rspec/rspec-mocks","forks_url":"https://api.github.com/repos/rspec/rspec-mocks/forks","keys_url":"https://api.github.com/repos/rspec/rspec-mocks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rspec/rspec-mocks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rspec/rspec-mocks/teams","hooks_url":"https://api.github.com/repos/rspec/rspec-mocks/hooks","issue_events_url":"https://api.github.com/repos/rspec/rspec-mocks/issues/events{/number}","events_url":"https://api.github.com/repos/rspec/rspec-mocks/events","assignees_url":"https://api.github.com/repos/rspec/rspec-mocks/assignees{/user}","branches_url":"https://api.github.com/repos/rspec/rspec-mocks/branches{/branch}","tags_url":"https://api.github.com/repos/rspec/rspec-mocks/tags","blobs_url":"https://api.github.com/repos/rspec/rspec-mocks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rspec/rspec-mocks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rspec/rspec-mocks/git/refs{/sha}","trees_url":"https://api.github.com/repos/rspec/rspec-mocks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rspec/rspec-mocks/statuses/{sha}","languages_url":"https://api.github.com/repos/rspec/rspec-mocks/languages","stargazers_url":"https://api.github.com/repos/rspec/rspec-mocks/stargazers","contributors_url":"https://api.github.com/repos/rspec/rspec-mocks/contributors","subscribers_url":"https://api.github.com/repos/rspec/rspec-mocks/subscribers","subscription_url":"https://api.github.com/repos/rspec/rspec-mocks/subscription","commits_url":"https://api.github.com/repos/rspec/rspec-mocks/commits{/sha}","git_commits_url":"https://api.github.com/repos/rspec/rspec-mocks/git/commits{/sha}","comments_url":"https://api.github.com/repos/rspec/rspec-mocks/comments{/number}","issue_comment_url":"https://api.github.com/repos/rspec/rspec-mocks/issues/comments{/number}","contents_url":"https://api.github.com/repos/rspec/rspec-mocks/contents/{+path}","compare_url":"https://api.github.com/repos/rspec/rspec-mocks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rspec/rspec-mocks/merges","archive_url":"https://api.github.com/repos/rspec/rspec-mocks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rspec/rspec-mocks/downloads","issues_url":"https://api.github.com/repos/rspec/rspec-mocks/issues{/number}","pulls_url":"https://api.github.com/repos/rspec/rspec-mocks/pulls{/number}","milestones_url":"https://api.github.com/repos/rspec/rspec-mocks/milestones{/number}","notifications_url":"https://api.github.com/repos/rspec/rspec-mocks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rspec/rspec-mocks/labels{/name}","releases_url":"https://api.github.com/repos/rspec/rspec-mocks/releases{/id}","created_at":"2009-06-29T15:56:06Z","updated_at":"2016-01-13T02:29:01Z","pushed_at":"2016-01-14T14:14:20Z","git_url":"git://github.com/rspec/rspec-mocks.git","ssh_url":"git@github.com:rspec/rspec-mocks.git","clone_url":"https://github.com/rspec/rspec-mocks.git","svn_url":"https://github.com/rspec/rspec-mocks","homepage":"http://relishapp.com/rspec/rspec-mocks","size":7964,"stargazers_count":626,"watchers_count":626,"language":"Ruby","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":222,"mirror_url":null,"open_issues_count":27,"forks":222,"open_issues":27,"watchers":626,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rspec/rspec-mocks/pulls/1054"},"html":{"href":"https://github.com/rspec/rspec-mocks/pull/1054"},"issue":{"href":"https://api.github.com/repos/rspec/rspec-mocks/issues/1054"},"comments":{"href":"https://api.github.com/repos/rspec/rspec-mocks/issues/1054/comments"},"review_comments":{"href":"https://api.github.com/repos/rspec/rspec-mocks/pulls/1054/comments"},"review_comment":{"href":"https://api.github.com/repos/rspec/rspec-mocks/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rspec/rspec-mocks/pulls/1054/commits"},"statuses":{"href":"https://api.github.com/repos/rspec/rspec-mocks/statuses/0e1b36f2ebf2a4a479bd8fbaeadfa245825d01f9"}}}}