{"action":"created","comment":{"url":"https://api.github.com/repos/envato/stack_master/pulls/comments/138251632","pull_request_review_id":62020117,"id":138251632,"diff_hunk":"@@ -1,16 +1,16 @@\n-RSpec.shared_examples 'validate valid parameter' do |validator_class, parameter|\n+RSpec.shared_examples 'validate valid parameter' do |parameter|\n   context \"with parameter #{parameter}\" do\n-    subject(:validator) { validator_class.new('name', definition, parameter).tap {|validator| validator.validate} }\n+    subject(:validator) { described_class.new('name', definition, parameter).tap {|validator| validator.validate} }\n \n     it 'is valid' do\n       expect(validator.is_valid).to be_truthy\n     end\n   end\n end\n \n-RSpec.shared_examples 'validate invalid parameter' do |validator_class, parameter, errors|\n+RSpec.shared_examples 'validate invalid parameter' do |parameter, errors|\n   context \"with parameter #{parameter}\" do\n-    subject(:validator) { validator_class.new(name, definition, parameter).tap {|validator| validator.validate} }\n+    subject(:validator) { described_class.new(name, definition, parameter).tap {|validator| validator.validate} }","path":"spec/support/validator_spec.rb","position":null,"original_position":17,"commit_id":"c7dc7d2ada669c9044aa2f7019c9106b5836cdf8","original_commit_id":"c7dc7d2ada669c9044aa2f7019c9106b5836cdf8","user":{"login":"patrobinson","id":2901882,"avatar_url":"https://avatars0.githubusercontent.com/u/2901882?v=4","gravatar_id":"","url":"https://api.github.com/users/patrobinson","html_url":"https://github.com/patrobinson","followers_url":"https://api.github.com/users/patrobinson/followers","following_url":"https://api.github.com/users/patrobinson/following{/other_user}","gists_url":"https://api.github.com/users/patrobinson/gists{/gist_id}","starred_url":"https://api.github.com/users/patrobinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patrobinson/subscriptions","organizations_url":"https://api.github.com/users/patrobinson/orgs","repos_url":"https://api.github.com/users/patrobinson/repos","events_url":"https://api.github.com/users/patrobinson/events{/privacy}","received_events_url":"https://api.github.com/users/patrobinson/received_events","type":"User","site_admin":false},"body":"duh why didn't I think of that!","created_at":"2017-09-12T04:58:45Z","updated_at":"2017-09-12T04:58:45Z","html_url":"https://github.com/envato/stack_master/pull/196#discussion_r138251632","pull_request_url":"https://api.github.com/repos/envato/stack_master/pulls/196","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/envato/stack_master/pulls/comments/138251632"},"html":{"href":"https://github.com/envato/stack_master/pull/196#discussion_r138251632"},"pull_request":{"href":"https://api.github.com/repos/envato/stack_master/pulls/196"}}},"pull_request":{"url":"https://api.github.com/repos/envato/stack_master/pulls/196","id":140256157,"html_url":"https://github.com/envato/stack_master/pull/196","diff_url":"https://github.com/envato/stack_master/pull/196.diff","patch_url":"https://github.com/envato/stack_master/pull/196.patch","issue_url":"https://api.github.com/repos/envato/stack_master/issues/196","number":196,"state":"open","locked":false,"title":"Use shared examples","user":{"login":"patrobinson","id":2901882,"avatar_url":"https://avatars0.githubusercontent.com/u/2901882?v=4","gravatar_id":"","url":"https://api.github.com/users/patrobinson","html_url":"https://github.com/patrobinson","followers_url":"https://api.github.com/users/patrobinson/followers","following_url":"https://api.github.com/users/patrobinson/following{/other_user}","gists_url":"https://api.github.com/users/patrobinson/gists{/gist_id}","starred_url":"https://api.github.com/users/patrobinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patrobinson/subscriptions","organizations_url":"https://api.github.com/users/patrobinson/orgs","repos_url":"https://api.github.com/users/patrobinson/repos","events_url":"https://api.github.com/users/patrobinson/events{/privacy}","received_events_url":"https://api.github.com/users/patrobinson/received_events","type":"User","site_admin":false},"body":"This is an alternate implementation of the spec examples in #195 using RSpec shared examples. This DRYs up the code a bit and makes it a bit easier to read. Here's some example test output:\r\n\r\n```\r\nStackMaster::SparkleFormation::CompileTime::StringValidator\r\n  #validate\r\n    string validation\r\n      with parameter {}\r\n        is not valid\r\n        has an error\r\n      with parameter a\r\n        is valid\r\n```\r\n\r\nand an error:\r\n\r\n```\r\n  2) StackMaster::SparkleFormation::CompileTime::StringValidator#validate string validation {} has an error\r\n     Failure/Error: expect(invalid_parameter_validator.error).to eql error_message.call(errored_parameters, validator_definition)\r\n\r\n       expected: \"name:[{}] are not Numbers\"\r\n            got: \"name:[{}] are not Strings\"\r\n\r\n       (compared using eql?)\r\n     Shared Example Group: \"validate invalid parameter\" called from ./spec/stack_master/sparkle_formation/compile_time/string_validator_spec.rb:12\r\n     # ./spec/support/validator_spec.rb:21:in `block (3 levels) in <top (required)>'\r\n\r\n```\r\n\r\n(note it points to the right spec file and test line `string_validator_spec.rb:12`)","created_at":"2017-09-11T06:09:45Z","updated_at":"2017-09-12T04:58:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0013e20936d3645e37bb230a9e94dcaa57bdcb10","assignee":null,"assignees":[],"requested_reviewers":[{"login":"gstib","id":1435181,"avatar_url":"https://avatars1.githubusercontent.com/u/1435181?v=4","gravatar_id":"","url":"https://api.github.com/users/gstib","html_url":"https://github.com/gstib","followers_url":"https://api.github.com/users/gstib/followers","following_url":"https://api.github.com/users/gstib/following{/other_user}","gists_url":"https://api.github.com/users/gstib/gists{/gist_id}","starred_url":"https://api.github.com/users/gstib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gstib/subscriptions","organizations_url":"https://api.github.com/users/gstib/orgs","repos_url":"https://api.github.com/users/gstib/repos","events_url":"https://api.github.com/users/gstib/events{/privacy}","received_events_url":"https://api.github.com/users/gstib/received_events","type":"User","site_admin":false},{"login":"shivaman","id":7812325,"avatar_url":"https://avatars0.githubusercontent.com/u/7812325?v=4","gravatar_id":"","url":"https://api.github.com/users/shivaman","html_url":"https://github.com/shivaman","followers_url":"https://api.github.com/users/shivaman/followers","following_url":"https://api.github.com/users/shivaman/following{/other_user}","gists_url":"https://api.github.com/users/shivaman/gists{/gist_id}","starred_url":"https://api.github.com/users/shivaman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shivaman/subscriptions","organizations_url":"https://api.github.com/users/shivaman/orgs","repos_url":"https://api.github.com/users/shivaman/repos","events_url":"https://api.github.com/users/shivaman/events{/privacy}","received_events_url":"https://api.github.com/users/shivaman/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/envato/stack_master/pulls/196/commits","review_comments_url":"https://api.github.com/repos/envato/stack_master/pulls/196/comments","review_comment_url":"https://api.github.com/repos/envato/stack_master/pulls/comments{/number}","comments_url":"https://api.github.com/repos/envato/stack_master/issues/196/comments","statuses_url":"https://api.github.com/repos/envato/stack_master/statuses/c7dc7d2ada669c9044aa2f7019c9106b5836cdf8","head":{"label":"envato:use-shared-examples","ref":"use-shared-examples","sha":"c7dc7d2ada669c9044aa2f7019c9106b5836cdf8","user":{"login":"envato","id":14786,"avatar_url":"https://avatars0.githubusercontent.com/u/14786?v=4","gravatar_id":"","url":"https://api.github.com/users/envato","html_url":"https://github.com/envato","followers_url":"https://api.github.com/users/envato/followers","following_url":"https://api.github.com/users/envato/following{/other_user}","gists_url":"https://api.github.com/users/envato/gists{/gist_id}","starred_url":"https://api.github.com/users/envato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/envato/subscriptions","organizations_url":"https://api.github.com/users/envato/orgs","repos_url":"https://api.github.com/users/envato/repos","events_url":"https://api.github.com/users/envato/events{/privacy}","received_events_url":"https://api.github.com/users/envato/received_events","type":"Organization","site_admin":false},"repo":{"id":44935321,"name":"stack_master","full_name":"envato/stack_master","owner":{"login":"envato","id":14786,"avatar_url":"https://avatars0.githubusercontent.com/u/14786?v=4","gravatar_id":"","url":"https://api.github.com/users/envato","html_url":"https://github.com/envato","followers_url":"https://api.github.com/users/envato/followers","following_url":"https://api.github.com/users/envato/following{/other_user}","gists_url":"https://api.github.com/users/envato/gists{/gist_id}","starred_url":"https://api.github.com/users/envato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/envato/subscriptions","organizations_url":"https://api.github.com/users/envato/orgs","repos_url":"https://api.github.com/users/envato/repos","events_url":"https://api.github.com/users/envato/events{/privacy}","received_events_url":"https://api.github.com/users/envato/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/envato/stack_master","description":"The missing CloudFormation tool","fork":false,"url":"https://api.github.com/repos/envato/stack_master","forks_url":"https://api.github.com/repos/envato/stack_master/forks","keys_url":"https://api.github.com/repos/envato/stack_master/keys{/key_id}","collaborators_url":"https://api.github.com/repos/envato/stack_master/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/envato/stack_master/teams","hooks_url":"https://api.github.com/repos/envato/stack_master/hooks","issue_events_url":"https://api.github.com/repos/envato/stack_master/issues/events{/number}","events_url":"https://api.github.com/repos/envato/stack_master/events","assignees_url":"https://api.github.com/repos/envato/stack_master/assignees{/user}","branches_url":"https://api.github.com/repos/envato/stack_master/branches{/branch}","tags_url":"https://api.github.com/repos/envato/stack_master/tags","blobs_url":"https://api.github.com/repos/envato/stack_master/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/envato/stack_master/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/envato/stack_master/git/refs{/sha}","trees_url":"https://api.github.com/repos/envato/stack_master/git/trees{/sha}","statuses_url":"https://api.github.com/repos/envato/stack_master/statuses/{sha}","languages_url":"https://api.github.com/repos/envato/stack_master/languages","stargazers_url":"https://api.github.com/repos/envato/stack_master/stargazers","contributors_url":"https://api.github.com/repos/envato/stack_master/contributors","subscribers_url":"https://api.github.com/repos/envato/stack_master/subscribers","subscription_url":"https://api.github.com/repos/envato/stack_master/subscription","commits_url":"https://api.github.com/repos/envato/stack_master/commits{/sha}","git_commits_url":"https://api.github.com/repos/envato/stack_master/git/commits{/sha}","comments_url":"https://api.github.com/repos/envato/stack_master/comments{/number}","issue_comment_url":"https://api.github.com/repos/envato/stack_master/issues/comments{/number}","contents_url":"https://api.github.com/repos/envato/stack_master/contents/{+path}","compare_url":"https://api.github.com/repos/envato/stack_master/compare/{base}...{head}","merges_url":"https://api.github.com/repos/envato/stack_master/merges","archive_url":"https://api.github.com/repos/envato/stack_master/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/envato/stack_master/downloads","issues_url":"https://api.github.com/repos/envato/stack_master/issues{/number}","pulls_url":"https://api.github.com/repos/envato/stack_master/pulls{/number}","milestones_url":"https://api.github.com/repos/envato/stack_master/milestones{/number}","notifications_url":"https://api.github.com/repos/envato/stack_master/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/envato/stack_master/labels{/name}","releases_url":"https://api.github.com/repos/envato/stack_master/releases{/id}","deployments_url":"https://api.github.com/repos/envato/stack_master/deployments","created_at":"2015-10-25T23:40:28Z","updated_at":"2017-09-06T13:40:28Z","pushed_at":"2017-09-12T00:07:09Z","git_url":"git://github.com/envato/stack_master.git","ssh_url":"git@github.com:envato/stack_master.git","clone_url":"https://github.com/envato/stack_master.git","svn_url":"https://github.com/envato/stack_master","homepage":"https://github.com/envato/stack_master","size":1157,"stargazers_count":135,"watchers_count":135,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":29,"mirror_url":null,"open_issues_count":39,"forks":29,"open_issues":39,"watchers":135,"default_branch":"master"}},"base":{"label":"envato:compile-time-parameters","ref":"compile-time-parameters","sha":"dd1ef0743472ca28a3bb80ee17db101a7898ce24","user":{"login":"envato","id":14786,"avatar_url":"https://avatars0.githubusercontent.com/u/14786?v=4","gravatar_id":"","url":"https://api.github.com/users/envato","html_url":"https://github.com/envato","followers_url":"https://api.github.com/users/envato/followers","following_url":"https://api.github.com/users/envato/following{/other_user}","gists_url":"https://api.github.com/users/envato/gists{/gist_id}","starred_url":"https://api.github.com/users/envato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/envato/subscriptions","organizations_url":"https://api.github.com/users/envato/orgs","repos_url":"https://api.github.com/users/envato/repos","events_url":"https://api.github.com/users/envato/events{/privacy}","received_events_url":"https://api.github.com/users/envato/received_events","type":"Organization","site_admin":false},"repo":{"id":44935321,"name":"stack_master","full_name":"envato/stack_master","owner":{"login":"envato","id":14786,"avatar_url":"https://avatars0.githubusercontent.com/u/14786?v=4","gravatar_id":"","url":"https://api.github.com/users/envato","html_url":"https://github.com/envato","followers_url":"https://api.github.com/users/envato/followers","following_url":"https://api.github.com/users/envato/following{/other_user}","gists_url":"https://api.github.com/users/envato/gists{/gist_id}","starred_url":"https://api.github.com/users/envato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/envato/subscriptions","organizations_url":"https://api.github.com/users/envato/orgs","repos_url":"https://api.github.com/users/envato/repos","events_url":"https://api.github.com/users/envato/events{/privacy}","received_events_url":"https://api.github.com/users/envato/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/envato/stack_master","description":"The missing CloudFormation tool","fork":false,"url":"https://api.github.com/repos/envato/stack_master","forks_url":"https://api.github.com/repos/envato/stack_master/forks","keys_url":"https://api.github.com/repos/envato/stack_master/keys{/key_id}","collaborators_url":"https://api.github.com/repos/envato/stack_master/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/envato/stack_master/teams","hooks_url":"https://api.github.com/repos/envato/stack_master/hooks","issue_events_url":"https://api.github.com/repos/envato/stack_master/issues/events{/number}","events_url":"https://api.github.com/repos/envato/stack_master/events","assignees_url":"https://api.github.com/repos/envato/stack_master/assignees{/user}","branches_url":"https://api.github.com/repos/envato/stack_master/branches{/branch}","tags_url":"https://api.github.com/repos/envato/stack_master/tags","blobs_url":"https://api.github.com/repos/envato/stack_master/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/envato/stack_master/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/envato/stack_master/git/refs{/sha}","trees_url":"https://api.github.com/repos/envato/stack_master/git/trees{/sha}","statuses_url":"https://api.github.com/repos/envato/stack_master/statuses/{sha}","languages_url":"https://api.github.com/repos/envato/stack_master/languages","stargazers_url":"https://api.github.com/repos/envato/stack_master/stargazers","contributors_url":"https://api.github.com/repos/envato/stack_master/contributors","subscribers_url":"https://api.github.com/repos/envato/stack_master/subscribers","subscription_url":"https://api.github.com/repos/envato/stack_master/subscription","commits_url":"https://api.github.com/repos/envato/stack_master/commits{/sha}","git_commits_url":"https://api.github.com/repos/envato/stack_master/git/commits{/sha}","comments_url":"https://api.github.com/repos/envato/stack_master/comments{/number}","issue_comment_url":"https://api.github.com/repos/envato/stack_master/issues/comments{/number}","contents_url":"https://api.github.com/repos/envato/stack_master/contents/{+path}","compare_url":"https://api.github.com/repos/envato/stack_master/compare/{base}...{head}","merges_url":"https://api.github.com/repos/envato/stack_master/merges","archive_url":"https://api.github.com/repos/envato/stack_master/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/envato/stack_master/downloads","issues_url":"https://api.github.com/repos/envato/stack_master/issues{/number}","pulls_url":"https://api.github.com/repos/envato/stack_master/pulls{/number}","milestones_url":"https://api.github.com/repos/envato/stack_master/milestones{/number}","notifications_url":"https://api.github.com/repos/envato/stack_master/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/envato/stack_master/labels{/name}","releases_url":"https://api.github.com/repos/envato/stack_master/releases{/id}","deployments_url":"https://api.github.com/repos/envato/stack_master/deployments","created_at":"2015-10-25T23:40:28Z","updated_at":"2017-09-06T13:40:28Z","pushed_at":"2017-09-12T00:07:09Z","git_url":"git://github.com/envato/stack_master.git","ssh_url":"git@github.com:envato/stack_master.git","clone_url":"https://github.com/envato/stack_master.git","svn_url":"https://github.com/envato/stack_master","homepage":"https://github.com/envato/stack_master","size":1157,"stargazers_count":135,"watchers_count":135,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":29,"mirror_url":null,"open_issues_count":39,"forks":29,"open_issues":39,"watchers":135,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/envato/stack_master/pulls/196"},"html":{"href":"https://github.com/envato/stack_master/pull/196"},"issue":{"href":"https://api.github.com/repos/envato/stack_master/issues/196"},"comments":{"href":"https://api.github.com/repos/envato/stack_master/issues/196/comments"},"review_comments":{"href":"https://api.github.com/repos/envato/stack_master/pulls/196/comments"},"review_comment":{"href":"https://api.github.com/repos/envato/stack_master/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/envato/stack_master/pulls/196/commits"},"statuses":{"href":"https://api.github.com/repos/envato/stack_master/statuses/c7dc7d2ada669c9044aa2f7019c9106b5836cdf8"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"patrobinson"}}