{"action":"created","comment":{"url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/pulls/comments/23428753","id":23428753,"diff_hunk":"@@ -0,0 +1,50 @@\n+module Shoulda\n+  module Matchers\n+    module ActiveModel\n+      module StrictValidator\n+        def allow_description(allowed_values)\n+          \"doesn't raise when #{attribute} is set to #{allowed_values}\"\n+        end\n+\n+        def expected_message_from(attribute_message)\n+          \"#{human_attribute_name} #{attribute_message}\"\n+        end\n+\n+        def formatted_messages\n+          [messages.first.message]\n+        end\n+\n+        def messages_description\n+          if has_messages?\n+            ': ' + messages.first.message.inspect\n+          else\n+            ' no exception'\n+          end\n+        end\n+\n+        def expected_messages_description(expected_message)\n+          if expected_message\n+            \"exception to include #{expected_message.inspect}\"\n+          else\n+            \"an exception to have been raised\"","path":"lib/shoulda/matchers/active_model/strict_validator.rb","position":29,"original_position":29,"commit_id":"60b09dab32c794e5b5ac32a3bc3850f8f77b2aef","original_commit_id":"60b09dab32c794e5b5ac32a3bc3850f8f77b2aef","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Prefer single-quoted strings when you don't need string interpolation or special symbols.","created_at":"2015-01-23T02:40:48Z","updated_at":"2015-01-23T02:40:48Z","html_url":"https://github.com/thoughtbot/shoulda-matchers/pull/642#discussion_r23428753","pull_request_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/pulls/642","_links":{"self":{"href":"https://api.github.com/repos/thoughtbot/shoulda-matchers/pulls/comments/23428753"},"html":{"href":"https://github.com/thoughtbot/shoulda-matchers/pull/642#discussion_r23428753"},"pull_request":{"href":"https://api.github.com/repos/thoughtbot/shoulda-matchers/pulls/642"}}},"pull_request":{"url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/pulls/642","id":27710902,"html_url":"https://github.com/thoughtbot/shoulda-matchers/pull/642","diff_url":"https://github.com/thoughtbot/shoulda-matchers/pull/642.diff","patch_url":"https://github.com/thoughtbot/shoulda-matchers/pull/642.patch","issue_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/issues/642","number":642,"state":"open","locked":false,"title":"Fix inclusion bug exceeding max value","user":{"login":"mcmire","id":7371,"avatar_url":"https://avatars.githubusercontent.com/u/7371?v=3","gravatar_id":"","url":"https://api.github.com/users/mcmire","html_url":"https://github.com/mcmire","followers_url":"https://api.github.com/users/mcmire/followers","following_url":"https://api.github.com/users/mcmire/following{/other_user}","gists_url":"https://api.github.com/users/mcmire/gists{/gist_id}","starred_url":"https://api.github.com/users/mcmire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcmire/subscriptions","organizations_url":"https://api.github.com/users/mcmire/orgs","repos_url":"https://api.github.com/users/mcmire/repos","events_url":"https://api.github.com/users/mcmire/events{/privacy}","received_events_url":"https://api.github.com/users/mcmire/received_events","type":"User","site_admin":false},"body":"This is a fix for both #634 and #637.\r\n\r\n----\r\n\r\nIn Rails 4.2, ActiveRecord was changed such that if you attempt to set\r\nan attribute to a value and that value is outside the range of the\r\ncolumn, then it will raise a RangeError. For instance, an integer column\r\nwith a limit of 2 (i.e. a smallint) only accepts values between -32768\r\nand +32767.\r\n\r\nThis means that if you try to do any of these three things, a RangeError\r\ncould be raised:\r\n\r\n* Use validate_numericality_of along with any of the comparison\r\n  submatchers and a value that sits on either side of the boundary.\r\n* Use allow_value with a value that sits outside the range.\r\n* Use validates_inclusion_of against an integer column. (Here we attempt\r\n  to set that column to a non-integer value to verify that the attribute\r\n  does not allow said value. That value is really a string version of a\r\n  large number, so if the column does not take large numbers then the\r\n  matcher could blow up.)\r\n\r\nAncillary changes in this commit:\r\n\r\n* Remove ValidationMessageFinder and ExceptionMessageFinder in favor of\r\n  Validator, StrictValidator, and ValidatorWithCapturedRangeError.\r\n* The allow_value matcher now uses an instance of Validator under the\r\n  hood. StrictValidator and/or ValidatorWithCapturedRangeError may be\r\n  mixed into the Validator object as needed.","created_at":"2015-01-20T20:49:37Z","updated_at":"2015-01-23T02:40:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"427f10b95f3234ac0e4e89fcdad339e15e8604e1","assignee":null,"milestone":{"url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/milestones/8","labels_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/milestones/8/labels","id":928932,"number":8,"title":"2.8.0","description":"","creator":{"login":"mcmire","id":7371,"avatar_url":"https://avatars.githubusercontent.com/u/7371?v=3","gravatar_id":"","url":"https://api.github.com/users/mcmire","html_url":"https://github.com/mcmire","followers_url":"https://api.github.com/users/mcmire/followers","following_url":"https://api.github.com/users/mcmire/following{/other_user}","gists_url":"https://api.github.com/users/mcmire/gists{/gist_id}","starred_url":"https://api.github.com/users/mcmire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcmire/subscriptions","organizations_url":"https://api.github.com/users/mcmire/orgs","repos_url":"https://api.github.com/users/mcmire/repos","events_url":"https://api.github.com/users/mcmire/events{/privacy}","received_events_url":"https://api.github.com/users/mcmire/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":1,"state":"open","created_at":"2015-01-09T17:10:40Z","updated_at":"2015-01-23T02:15:44Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/pulls/642/commits","review_comments_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/pulls/642/comments","review_comment_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/pulls/comments/{number}","comments_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/issues/642/comments","statuses_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/statuses/60b09dab32c794e5b5ac32a3bc3850f8f77b2aef","head":{"label":"thoughtbot:ew-fix-inclusion-bug","ref":"ew-fix-inclusion-bug","sha":"60b09dab32c794e5b5ac32a3bc3850f8f77b2aef","user":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?v=3","gravatar_id":"","url":"https://api.github.com/users/thoughtbot","html_url":"https://github.com/thoughtbot","followers_url":"https://api.github.com/users/thoughtbot/followers","following_url":"https://api.github.com/users/thoughtbot/following{/other_user}","gists_url":"https://api.github.com/users/thoughtbot/gists{/gist_id}","starred_url":"https://api.github.com/users/thoughtbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thoughtbot/subscriptions","organizations_url":"https://api.github.com/users/thoughtbot/orgs","repos_url":"https://api.github.com/users/thoughtbot/repos","events_url":"https://api.github.com/users/thoughtbot/events{/privacy}","received_events_url":"https://api.github.com/users/thoughtbot/received_events","type":"Organization","site_admin":false},"repo":{"id":1172597,"name":"shoulda-matchers","full_name":"thoughtbot/shoulda-matchers","owner":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?v=3","gravatar_id":"","url":"https://api.github.com/users/thoughtbot","html_url":"https://github.com/thoughtbot","followers_url":"https://api.github.com/users/thoughtbot/followers","following_url":"https://api.github.com/users/thoughtbot/following{/other_user}","gists_url":"https://api.github.com/users/thoughtbot/gists{/gist_id}","starred_url":"https://api.github.com/users/thoughtbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thoughtbot/subscriptions","organizations_url":"https://api.github.com/users/thoughtbot/orgs","repos_url":"https://api.github.com/users/thoughtbot/repos","events_url":"https://api.github.com/users/thoughtbot/events{/privacy}","received_events_url":"https://api.github.com/users/thoughtbot/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/thoughtbot/shoulda-matchers","description":"Collection of testing matchers extracted from Shoulda","fork":false,"url":"https://api.github.com/repos/thoughtbot/shoulda-matchers","forks_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/forks","keys_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/teams","hooks_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/hooks","issue_events_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/issues/events{/number}","events_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/events","assignees_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/assignees{/user}","branches_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/branches{/branch}","tags_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/tags","blobs_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/git/refs{/sha}","trees_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/statuses/{sha}","languages_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/languages","stargazers_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/stargazers","contributors_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/contributors","subscribers_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/subscribers","subscription_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/subscription","commits_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/commits{/sha}","git_commits_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/git/commits{/sha}","comments_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/comments{/number}","issue_comment_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/issues/comments/{number}","contents_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/contents/{+path}","compare_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/merges","archive_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/downloads","issues_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/issues{/number}","pulls_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/pulls{/number}","milestones_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/milestones{/number}","notifications_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/labels{/name}","releases_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/releases{/id}","created_at":"2010-12-15T22:41:52Z","updated_at":"2015-01-22T01:05:50Z","pushed_at":"2015-01-23T02:40:44Z","git_url":"git://github.com/thoughtbot/shoulda-matchers.git","ssh_url":"git@github.com:thoughtbot/shoulda-matchers.git","clone_url":"https://github.com/thoughtbot/shoulda-matchers.git","svn_url":"https://github.com/thoughtbot/shoulda-matchers","homepage":"http://thoughtbot.com/community","size":16631,"stargazers_count":1039,"watchers_count":1039,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":307,"mirror_url":null,"open_issues_count":41,"forks":307,"open_issues":41,"watchers":1039,"default_branch":"master"}},"base":{"label":"thoughtbot:master","ref":"master","sha":"948757b3f8af079869f2a94b628ee17db756b86d","user":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?v=3","gravatar_id":"","url":"https://api.github.com/users/thoughtbot","html_url":"https://github.com/thoughtbot","followers_url":"https://api.github.com/users/thoughtbot/followers","following_url":"https://api.github.com/users/thoughtbot/following{/other_user}","gists_url":"https://api.github.com/users/thoughtbot/gists{/gist_id}","starred_url":"https://api.github.com/users/thoughtbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thoughtbot/subscriptions","organizations_url":"https://api.github.com/users/thoughtbot/orgs","repos_url":"https://api.github.com/users/thoughtbot/repos","events_url":"https://api.github.com/users/thoughtbot/events{/privacy}","received_events_url":"https://api.github.com/users/thoughtbot/received_events","type":"Organization","site_admin":false},"repo":{"id":1172597,"name":"shoulda-matchers","full_name":"thoughtbot/shoulda-matchers","owner":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?v=3","gravatar_id":"","url":"https://api.github.com/users/thoughtbot","html_url":"https://github.com/thoughtbot","followers_url":"https://api.github.com/users/thoughtbot/followers","following_url":"https://api.github.com/users/thoughtbot/following{/other_user}","gists_url":"https://api.github.com/users/thoughtbot/gists{/gist_id}","starred_url":"https://api.github.com/users/thoughtbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thoughtbot/subscriptions","organizations_url":"https://api.github.com/users/thoughtbot/orgs","repos_url":"https://api.github.com/users/thoughtbot/repos","events_url":"https://api.github.com/users/thoughtbot/events{/privacy}","received_events_url":"https://api.github.com/users/thoughtbot/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/thoughtbot/shoulda-matchers","description":"Collection of testing matchers extracted from Shoulda","fork":false,"url":"https://api.github.com/repos/thoughtbot/shoulda-matchers","forks_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/forks","keys_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/teams","hooks_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/hooks","issue_events_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/issues/events{/number}","events_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/events","assignees_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/assignees{/user}","branches_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/branches{/branch}","tags_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/tags","blobs_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/git/refs{/sha}","trees_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/statuses/{sha}","languages_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/languages","stargazers_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/stargazers","contributors_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/contributors","subscribers_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/subscribers","subscription_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/subscription","commits_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/commits{/sha}","git_commits_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/git/commits{/sha}","comments_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/comments{/number}","issue_comment_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/issues/comments/{number}","contents_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/contents/{+path}","compare_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/merges","archive_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/downloads","issues_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/issues{/number}","pulls_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/pulls{/number}","milestones_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/milestones{/number}","notifications_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/labels{/name}","releases_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/releases{/id}","created_at":"2010-12-15T22:41:52Z","updated_at":"2015-01-22T01:05:50Z","pushed_at":"2015-01-23T02:40:44Z","git_url":"git://github.com/thoughtbot/shoulda-matchers.git","ssh_url":"git@github.com:thoughtbot/shoulda-matchers.git","clone_url":"https://github.com/thoughtbot/shoulda-matchers.git","svn_url":"https://github.com/thoughtbot/shoulda-matchers","homepage":"http://thoughtbot.com/community","size":16631,"stargazers_count":1039,"watchers_count":1039,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":307,"mirror_url":null,"open_issues_count":41,"forks":307,"open_issues":41,"watchers":1039,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/thoughtbot/shoulda-matchers/pulls/642"},"html":{"href":"https://github.com/thoughtbot/shoulda-matchers/pull/642"},"issue":{"href":"https://api.github.com/repos/thoughtbot/shoulda-matchers/issues/642"},"comments":{"href":"https://api.github.com/repos/thoughtbot/shoulda-matchers/issues/642/comments"},"review_comments":{"href":"https://api.github.com/repos/thoughtbot/shoulda-matchers/pulls/642/comments"},"review_comment":{"href":"https://api.github.com/repos/thoughtbot/shoulda-matchers/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/thoughtbot/shoulda-matchers/pulls/642/commits"},"statuses":{"href":"https://api.github.com/repos/thoughtbot/shoulda-matchers/statuses/60b09dab32c794e5b5ac32a3bc3850f8f77b2aef"}}}}