{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/pulls/comments/99693406","pull_request_review_id":20362858,"id":99693406,"diff_hunk":"@@ -0,0 +1,367 @@\n+# Copyright 2017 Google, Inc\n+#\n+# Licensed under the Apache License, Version 2.0 (the \"License\");\n+# you may not use this file except in compliance with the License.\n+# You may obtain a copy of the License at\n+#\n+#     http://www.apache.org/licenses/LICENSE-2.0\n+#\n+# Unless required by applicable law or agreed to in writing, software\n+# distributed under the License is distributed on an \"AS IS\" BASIS,\n+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+# See the License for the specific language governing permissions and\n+# limitations under the License.\n+\n+require \"rspec\"\n+require \"tempfile\"\n+require \"google/apis/cloudkms_v1beta1\"\n+require_relative \"../kms\"\n+\n+describe \"Key Management Service\" do\n+\n+  def create_service_client\n+    kms_client = Google::Apis::CloudkmsV1beta1::CloudKMSService.new\n+    kms_client.authorization = Google::Auth.get_application_default(\n+      \"https://www.googleapis.com/auth/cloud-platform\"\n+    )\n+    kms_client\n+  end\n+\n+  def test_create_keyring project_id:, key_ring_id:, location:","path":"kms/spec/kms_spec.rb","position":30,"original_position":30,"commit_id":"06266937dfce2cf739ec0828f9ef83118b636f93","original_commit_id":"06266937dfce2cf739ec0828f9ef83118b636f93","user":{"login":"remi","id":280,"avatar_url":"https://avatars.githubusercontent.com/u/280?v=3","gravatar_id":"","url":"https://api.github.com/users/remi","html_url":"https://github.com/remi","followers_url":"https://api.github.com/users/remi/followers","following_url":"https://api.github.com/users/remi/following{/other_user}","gists_url":"https://api.github.com/users/remi/gists{/gist_id}","starred_url":"https://api.github.com/users/remi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/remi/subscriptions","organizations_url":"https://api.github.com/users/remi/orgs","repos_url":"https://api.github.com/users/remi/repos","events_url":"https://api.github.com/users/remi/events{/privacy}","received_events_url":"https://api.github.com/users/remi/received_events","type":"User","site_admin":false},"body":"When I first read this, I wondered if you were using [minitest](http://docs.seattlerb.org/minitest/#label-Unit+tests) because of the [`def test_something`](http://docs.seattlerb.org/minitest/#label-Unit+tests) method.\r\n\r\nThen I guessed that, because you prefixed the method with `test_` that maybe you were doing *tons* of identical assertions so you refactored them into a method.  I read `test_create_keyring` and I think I should pass my key ring to this method and it will test it for me.\r\n\r\n**tl;dr** Rename these, eg. `create_test_keyring` (similar to `create_service_client`) ","created_at":"2017-02-06T21:51:42Z","updated_at":"2017-02-06T22:02:14Z","html_url":"https://github.com/GoogleCloudPlatform/ruby-docs-samples/pull/144#discussion_r99693406","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/pulls/144","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/pulls/comments/99693406"},"html":{"href":"https://github.com/GoogleCloudPlatform/ruby-docs-samples/pull/144#discussion_r99693406"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/pulls/144"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/pulls/144","id":104638652,"html_url":"https://github.com/GoogleCloudPlatform/ruby-docs-samples/pull/144","diff_url":"https://github.com/GoogleCloudPlatform/ruby-docs-samples/pull/144.diff","patch_url":"https://github.com/GoogleCloudPlatform/ruby-docs-samples/pull/144.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/issues/144","number":144,"state":"open","locked":false,"title":"Adding KMS Sample","user":{"login":"frankyn","id":1907648,"avatar_url":"https://avatars.githubusercontent.com/u/1907648?v=3","gravatar_id":"","url":"https://api.github.com/users/frankyn","html_url":"https://github.com/frankyn","followers_url":"https://api.github.com/users/frankyn/followers","following_url":"https://api.github.com/users/frankyn/following{/other_user}","gists_url":"https://api.github.com/users/frankyn/gists{/gist_id}","starred_url":"https://api.github.com/users/frankyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frankyn/subscriptions","organizations_url":"https://api.github.com/users/frankyn/orgs","repos_url":"https://api.github.com/users/frankyn/repos","events_url":"https://api.github.com/users/frankyn/events{/privacy}","received_events_url":"https://api.github.com/users/frankyn/received_events","type":"User","site_admin":false},"body":"KMS Sample contains samples with tests for the following operations:\r\n\r\n* quickstart\r\n* Create a Key Ring\r\n* Create a CryptoKey\r\n* Encrypt file (with CLI)\r\n* Decrypt file (with CLI)\r\n* Disable CryptoKey Version\r\n* Destroy CryptoKey Version\r\n* Add Member to CryptoKey IAM policy\r\n* Get KeyRing Policy\r\n* Create CryptoKey Version ","created_at":"2017-02-04T00:37:29Z","updated_at":"2017-02-06T22:02:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d08507a9564d2b3b02082adaf6bf70ab17422617","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/pulls/144/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/pulls/144/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/issues/144/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/statuses/06266937dfce2cf739ec0828f9ef83118b636f93","head":{"label":"GoogleCloudPlatform:kms-sample","ref":"kms-sample","sha":"06266937dfce2cf739ec0828f9ef83118b636f93","user":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":41501829,"name":"ruby-docs-samples","full_name":"GoogleCloudPlatform/ruby-docs-samples","owner":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleCloudPlatform/ruby-docs-samples","description":"Ruby code samples used on https://cloud.google.com","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/releases{/id}","deployments_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/deployments","created_at":"2015-08-27T17:40:52Z","updated_at":"2017-01-03T23:54:45Z","pushed_at":"2017-02-06T20:35:36Z","git_url":"git://github.com/GoogleCloudPlatform/ruby-docs-samples.git","ssh_url":"git@github.com:GoogleCloudPlatform/ruby-docs-samples.git","clone_url":"https://github.com/GoogleCloudPlatform/ruby-docs-samples.git","svn_url":"https://github.com/GoogleCloudPlatform/ruby-docs-samples","homepage":"https://cloud.google.com/ruby","size":1722,"stargazers_count":25,"watchers_count":25,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":22,"mirror_url":null,"open_issues_count":31,"forks":22,"open_issues":31,"watchers":25,"default_branch":"master"}},"base":{"label":"GoogleCloudPlatform:master","ref":"master","sha":"d2f70d534da3a05902f6412b19d08f1fca47ca25","user":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":41501829,"name":"ruby-docs-samples","full_name":"GoogleCloudPlatform/ruby-docs-samples","owner":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleCloudPlatform/ruby-docs-samples","description":"Ruby code samples used on https://cloud.google.com","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/releases{/id}","deployments_url":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/deployments","created_at":"2015-08-27T17:40:52Z","updated_at":"2017-01-03T23:54:45Z","pushed_at":"2017-02-06T20:35:36Z","git_url":"git://github.com/GoogleCloudPlatform/ruby-docs-samples.git","ssh_url":"git@github.com:GoogleCloudPlatform/ruby-docs-samples.git","clone_url":"https://github.com/GoogleCloudPlatform/ruby-docs-samples.git","svn_url":"https://github.com/GoogleCloudPlatform/ruby-docs-samples","homepage":"https://cloud.google.com/ruby","size":1722,"stargazers_count":25,"watchers_count":25,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":22,"mirror_url":null,"open_issues_count":31,"forks":22,"open_issues":31,"watchers":25,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/pulls/144"},"html":{"href":"https://github.com/GoogleCloudPlatform/ruby-docs-samples/pull/144"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/issues/144"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/issues/144/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/pulls/144/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/pulls/144/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/ruby-docs-samples/statuses/06266937dfce2cf739ec0828f9ef83118b636f93"}}}}
{"actor":{"display_login":"remi"}}