{"action":"created","comment":{"url":"https://api.github.com/repos/conduit/conduit-braintree/pulls/comments/32418994","id":32418994,"diff_hunk":"@@ -16,36 +15,61 @@ def initialize(base, options = nil)\n     end\n \n     def mock\n-      @stub = stub_request(:any, /braintree/).\n-        to_return(body: render_response, headers: {'Content-Encoding' => 'gzip'} )\n+      Artifice.activate_with fake_braintree\n     end\n \n     def unmock\n-      remove_request_stub(@stub) if @stub\n-      @stub = nil\n+      Artifice.deactivate\n     end\n \n     def with_mocking\n-      mock and yield.tap { unmock }\n+      mock\n+      yield.tap { unmock }","path":"lib/conduit/braintree/request_mocker/base.rb","position":31,"original_position":31,"commit_id":"f05ad7b9203dab59043d5ef986ea8bc302b423cd","original_commit_id":"f05ad7b9203dab59043d5ef986ea8bc302b423cd","user":{"login":"captainbeardo","id":834135,"avatar_url":"https://avatars.githubusercontent.com/u/834135?v=3","gravatar_id":"","url":"https://api.github.com/users/captainbeardo","html_url":"https://github.com/captainbeardo","followers_url":"https://api.github.com/users/captainbeardo/followers","following_url":"https://api.github.com/users/captainbeardo/following{/other_user}","gists_url":"https://api.github.com/users/captainbeardo/gists{/gist_id}","starred_url":"https://api.github.com/users/captainbeardo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/captainbeardo/subscriptions","organizations_url":"https://api.github.com/users/captainbeardo/orgs","repos_url":"https://api.github.com/users/captainbeardo/repos","events_url":"https://api.github.com/users/captainbeardo/events{/privacy}","received_events_url":"https://api.github.com/users/captainbeardo/received_events","type":"User","site_admin":false},"body":"Do we want to have the unmock in an ensure block?","created_at":"2015-06-15T13:29:02Z","updated_at":"2015-06-15T13:29:02Z","html_url":"https://github.com/conduit/conduit-braintree/pull/20#discussion_r32418994","pull_request_url":"https://api.github.com/repos/conduit/conduit-braintree/pulls/20","_links":{"self":{"href":"https://api.github.com/repos/conduit/conduit-braintree/pulls/comments/32418994"},"html":{"href":"https://github.com/conduit/conduit-braintree/pull/20#discussion_r32418994"},"pull_request":{"href":"https://api.github.com/repos/conduit/conduit-braintree/pulls/20"}}},"pull_request":{"url":"https://api.github.com/repos/conduit/conduit-braintree/pulls/20","id":37659708,"html_url":"https://github.com/conduit/conduit-braintree/pull/20","diff_url":"https://github.com/conduit/conduit-braintree/pull/20.diff","patch_url":"https://github.com/conduit/conduit-braintree/pull/20.patch","issue_url":"https://api.github.com/repos/conduit/conduit-braintree/issues/20","number":20,"state":"open","locked":false,"title":"use artifice instead of webmock for blacklist request mocks","user":{"login":"davidtrogers","id":50646,"avatar_url":"https://avatars.githubusercontent.com/u/50646?v=3","gravatar_id":"","url":"https://api.github.com/users/davidtrogers","html_url":"https://github.com/davidtrogers","followers_url":"https://api.github.com/users/davidtrogers/followers","following_url":"https://api.github.com/users/davidtrogers/following{/other_user}","gists_url":"https://api.github.com/users/davidtrogers/gists{/gist_id}","starred_url":"https://api.github.com/users/davidtrogers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidtrogers/subscriptions","organizations_url":"https://api.github.com/users/davidtrogers/orgs","repos_url":"https://api.github.com/users/davidtrogers/repos","events_url":"https://api.github.com/users/davidtrogers/events{/privacy}","received_events_url":"https://api.github.com/users/davidtrogers/received_events","type":"User","site_admin":false},"body":"This uses [artifice](https://github.com/wycats/artifice) instead of [webmock](https://github.com/bblimke/webmock) to avoid the effect of blocking all HTTP requests unless explicitly allowed, i.e. whitelist. In this case, we block requests to braintree and we allow all other requests to pass through (using [artifice-passthru](https://github.com/tpope/artifice-passthru) ) for a blacklist approach.","created_at":"2015-06-15T05:39:50Z","updated_at":"2015-06-15T13:29:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8566bb43480990df7815a8465418fe8fa906aaa5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/conduit/conduit-braintree/pulls/20/commits","review_comments_url":"https://api.github.com/repos/conduit/conduit-braintree/pulls/20/comments","review_comment_url":"https://api.github.com/repos/conduit/conduit-braintree/pulls/comments{/number}","comments_url":"https://api.github.com/repos/conduit/conduit-braintree/issues/20/comments","statuses_url":"https://api.github.com/repos/conduit/conduit-braintree/statuses/f05ad7b9203dab59043d5ef986ea8bc302b423cd","head":{"label":"conduit:artifice","ref":"artifice","sha":"f05ad7b9203dab59043d5ef986ea8bc302b423cd","user":{"login":"conduit","id":7139444,"avatar_url":"https://avatars.githubusercontent.com/u/7139444?v=3","gravatar_id":"","url":"https://api.github.com/users/conduit","html_url":"https://github.com/conduit","followers_url":"https://api.github.com/users/conduit/followers","following_url":"https://api.github.com/users/conduit/following{/other_user}","gists_url":"https://api.github.com/users/conduit/gists{/gist_id}","starred_url":"https://api.github.com/users/conduit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/conduit/subscriptions","organizations_url":"https://api.github.com/users/conduit/orgs","repos_url":"https://api.github.com/users/conduit/repos","events_url":"https://api.github.com/users/conduit/events{/privacy}","received_events_url":"https://api.github.com/users/conduit/received_events","type":"Organization","site_admin":false},"repo":{"id":24723991,"name":"conduit-braintree","full_name":"conduit/conduit-braintree","owner":{"login":"conduit","id":7139444,"avatar_url":"https://avatars.githubusercontent.com/u/7139444?v=3","gravatar_id":"","url":"https://api.github.com/users/conduit","html_url":"https://github.com/conduit","followers_url":"https://api.github.com/users/conduit/followers","following_url":"https://api.github.com/users/conduit/following{/other_user}","gists_url":"https://api.github.com/users/conduit/gists{/gist_id}","starred_url":"https://api.github.com/users/conduit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/conduit/subscriptions","organizations_url":"https://api.github.com/users/conduit/orgs","repos_url":"https://api.github.com/users/conduit/repos","events_url":"https://api.github.com/users/conduit/events{/privacy}","received_events_url":"https://api.github.com/users/conduit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/conduit/conduit-braintree","description":"","fork":false,"url":"https://api.github.com/repos/conduit/conduit-braintree","forks_url":"https://api.github.com/repos/conduit/conduit-braintree/forks","keys_url":"https://api.github.com/repos/conduit/conduit-braintree/keys{/key_id}","collaborators_url":"https://api.github.com/repos/conduit/conduit-braintree/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/conduit/conduit-braintree/teams","hooks_url":"https://api.github.com/repos/conduit/conduit-braintree/hooks","issue_events_url":"https://api.github.com/repos/conduit/conduit-braintree/issues/events{/number}","events_url":"https://api.github.com/repos/conduit/conduit-braintree/events","assignees_url":"https://api.github.com/repos/conduit/conduit-braintree/assignees{/user}","branches_url":"https://api.github.com/repos/conduit/conduit-braintree/branches{/branch}","tags_url":"https://api.github.com/repos/conduit/conduit-braintree/tags","blobs_url":"https://api.github.com/repos/conduit/conduit-braintree/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/conduit/conduit-braintree/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/conduit/conduit-braintree/git/refs{/sha}","trees_url":"https://api.github.com/repos/conduit/conduit-braintree/git/trees{/sha}","statuses_url":"https://api.github.com/repos/conduit/conduit-braintree/statuses/{sha}","languages_url":"https://api.github.com/repos/conduit/conduit-braintree/languages","stargazers_url":"https://api.github.com/repos/conduit/conduit-braintree/stargazers","contributors_url":"https://api.github.com/repos/conduit/conduit-braintree/contributors","subscribers_url":"https://api.github.com/repos/conduit/conduit-braintree/subscribers","subscription_url":"https://api.github.com/repos/conduit/conduit-braintree/subscription","commits_url":"https://api.github.com/repos/conduit/conduit-braintree/commits{/sha}","git_commits_url":"https://api.github.com/repos/conduit/conduit-braintree/git/commits{/sha}","comments_url":"https://api.github.com/repos/conduit/conduit-braintree/comments{/number}","issue_comment_url":"https://api.github.com/repos/conduit/conduit-braintree/issues/comments{/number}","contents_url":"https://api.github.com/repos/conduit/conduit-braintree/contents/{+path}","compare_url":"https://api.github.com/repos/conduit/conduit-braintree/compare/{base}...{head}","merges_url":"https://api.github.com/repos/conduit/conduit-braintree/merges","archive_url":"https://api.github.com/repos/conduit/conduit-braintree/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/conduit/conduit-braintree/downloads","issues_url":"https://api.github.com/repos/conduit/conduit-braintree/issues{/number}","pulls_url":"https://api.github.com/repos/conduit/conduit-braintree/pulls{/number}","milestones_url":"https://api.github.com/repos/conduit/conduit-braintree/milestones{/number}","notifications_url":"https://api.github.com/repos/conduit/conduit-braintree/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/conduit/conduit-braintree/labels{/name}","releases_url":"https://api.github.com/repos/conduit/conduit-braintree/releases{/id}","created_at":"2014-10-02T15:12:25Z","updated_at":"2015-04-20T20:41:01Z","pushed_at":"2015-06-15T05:39:51Z","git_url":"git://github.com/conduit/conduit-braintree.git","ssh_url":"git@github.com:conduit/conduit-braintree.git","clone_url":"https://github.com/conduit/conduit-braintree.git","svn_url":"https://github.com/conduit/conduit-braintree","homepage":null,"size":460,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"conduit:master","ref":"master","sha":"1c3a4b6d95af1e29167a66b78c618fe407a60152","user":{"login":"conduit","id":7139444,"avatar_url":"https://avatars.githubusercontent.com/u/7139444?v=3","gravatar_id":"","url":"https://api.github.com/users/conduit","html_url":"https://github.com/conduit","followers_url":"https://api.github.com/users/conduit/followers","following_url":"https://api.github.com/users/conduit/following{/other_user}","gists_url":"https://api.github.com/users/conduit/gists{/gist_id}","starred_url":"https://api.github.com/users/conduit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/conduit/subscriptions","organizations_url":"https://api.github.com/users/conduit/orgs","repos_url":"https://api.github.com/users/conduit/repos","events_url":"https://api.github.com/users/conduit/events{/privacy}","received_events_url":"https://api.github.com/users/conduit/received_events","type":"Organization","site_admin":false},"repo":{"id":24723991,"name":"conduit-braintree","full_name":"conduit/conduit-braintree","owner":{"login":"conduit","id":7139444,"avatar_url":"https://avatars.githubusercontent.com/u/7139444?v=3","gravatar_id":"","url":"https://api.github.com/users/conduit","html_url":"https://github.com/conduit","followers_url":"https://api.github.com/users/conduit/followers","following_url":"https://api.github.com/users/conduit/following{/other_user}","gists_url":"https://api.github.com/users/conduit/gists{/gist_id}","starred_url":"https://api.github.com/users/conduit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/conduit/subscriptions","organizations_url":"https://api.github.com/users/conduit/orgs","repos_url":"https://api.github.com/users/conduit/repos","events_url":"https://api.github.com/users/conduit/events{/privacy}","received_events_url":"https://api.github.com/users/conduit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/conduit/conduit-braintree","description":"","fork":false,"url":"https://api.github.com/repos/conduit/conduit-braintree","forks_url":"https://api.github.com/repos/conduit/conduit-braintree/forks","keys_url":"https://api.github.com/repos/conduit/conduit-braintree/keys{/key_id}","collaborators_url":"https://api.github.com/repos/conduit/conduit-braintree/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/conduit/conduit-braintree/teams","hooks_url":"https://api.github.com/repos/conduit/conduit-braintree/hooks","issue_events_url":"https://api.github.com/repos/conduit/conduit-braintree/issues/events{/number}","events_url":"https://api.github.com/repos/conduit/conduit-braintree/events","assignees_url":"https://api.github.com/repos/conduit/conduit-braintree/assignees{/user}","branches_url":"https://api.github.com/repos/conduit/conduit-braintree/branches{/branch}","tags_url":"https://api.github.com/repos/conduit/conduit-braintree/tags","blobs_url":"https://api.github.com/repos/conduit/conduit-braintree/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/conduit/conduit-braintree/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/conduit/conduit-braintree/git/refs{/sha}","trees_url":"https://api.github.com/repos/conduit/conduit-braintree/git/trees{/sha}","statuses_url":"https://api.github.com/repos/conduit/conduit-braintree/statuses/{sha}","languages_url":"https://api.github.com/repos/conduit/conduit-braintree/languages","stargazers_url":"https://api.github.com/repos/conduit/conduit-braintree/stargazers","contributors_url":"https://api.github.com/repos/conduit/conduit-braintree/contributors","subscribers_url":"https://api.github.com/repos/conduit/conduit-braintree/subscribers","subscription_url":"https://api.github.com/repos/conduit/conduit-braintree/subscription","commits_url":"https://api.github.com/repos/conduit/conduit-braintree/commits{/sha}","git_commits_url":"https://api.github.com/repos/conduit/conduit-braintree/git/commits{/sha}","comments_url":"https://api.github.com/repos/conduit/conduit-braintree/comments{/number}","issue_comment_url":"https://api.github.com/repos/conduit/conduit-braintree/issues/comments{/number}","contents_url":"https://api.github.com/repos/conduit/conduit-braintree/contents/{+path}","compare_url":"https://api.github.com/repos/conduit/conduit-braintree/compare/{base}...{head}","merges_url":"https://api.github.com/repos/conduit/conduit-braintree/merges","archive_url":"https://api.github.com/repos/conduit/conduit-braintree/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/conduit/conduit-braintree/downloads","issues_url":"https://api.github.com/repos/conduit/conduit-braintree/issues{/number}","pulls_url":"https://api.github.com/repos/conduit/conduit-braintree/pulls{/number}","milestones_url":"https://api.github.com/repos/conduit/conduit-braintree/milestones{/number}","notifications_url":"https://api.github.com/repos/conduit/conduit-braintree/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/conduit/conduit-braintree/labels{/name}","releases_url":"https://api.github.com/repos/conduit/conduit-braintree/releases{/id}","created_at":"2014-10-02T15:12:25Z","updated_at":"2015-04-20T20:41:01Z","pushed_at":"2015-06-15T05:39:51Z","git_url":"git://github.com/conduit/conduit-braintree.git","ssh_url":"git@github.com:conduit/conduit-braintree.git","clone_url":"https://github.com/conduit/conduit-braintree.git","svn_url":"https://github.com/conduit/conduit-braintree","homepage":null,"size":460,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/conduit/conduit-braintree/pulls/20"},"html":{"href":"https://github.com/conduit/conduit-braintree/pull/20"},"issue":{"href":"https://api.github.com/repos/conduit/conduit-braintree/issues/20"},"comments":{"href":"https://api.github.com/repos/conduit/conduit-braintree/issues/20/comments"},"review_comments":{"href":"https://api.github.com/repos/conduit/conduit-braintree/pulls/20/comments"},"review_comment":{"href":"https://api.github.com/repos/conduit/conduit-braintree/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/conduit/conduit-braintree/pulls/20/commits"},"statuses":{"href":"https://api.github.com/repos/conduit/conduit-braintree/statuses/f05ad7b9203dab59043d5ef986ea8bc302b423cd"}}}}